]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_tables: Reject tables of unsupported family
authorPhil Sutter <phil@nwl.cc>
Wed, 16 Feb 2022 14:55:38 +0000 (15:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Jan 2024 17:51:26 +0000 (18:51 +0100)
commitab3a3aadb373b47a1f401c7626608b1b214cec9e
tree5c58d815fa1b77c0c06db19daf07ab7c6cc4a2ac
parent0eb556b2386d14234f48e801f94784e14692b002
netfilter: nf_tables: Reject tables of unsupported family

commit f1082dd31fe461d482d69da2a8eccfeb7bf07ac2 upstream.

An nftables family is merely a hollow container, its family just a
number and such not reliant on compile-time options other than nftables
support itself. Add an artificial check so attempts at using a family
the kernel can't support fail as early as possible. This helps user
space detect kernels which lack e.g. NFPROTO_INET.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_tables_api.c