]> 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:48:07 +0000 (18:48 +0100)
commit25d1e7be85cf0a5afca5555f90e4609c40480ece
tree073c0b3592c2a20f1aa3460ad2c9db46cc8c0408
parent03585b18b715621a64ced023ca8c1fc36b6b2119
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