]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_tables: missing validation from the abort path
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 29 Oct 2020 12:50:03 +0000 (13:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:22:02 +0000 (19:22 +0100)
commite4bec74d3707f9bddb31ead69f930cf1a59f93e2
treeef75a48baa652875596eb37ddaceae5d81e96f39
parentaf9c23375c76fdfb57bd7104591c0d75e7c48d73
netfilter: nf_tables: missing validation from the abort path

[ Upstream commit c0391b6ab810381df632677a1dcbbbbd63d05b6d ]

If userspace does not include the trailing end of batch message, then
nfnetlink aborts the transaction. This allows to check that ruleset
updates trigger no errors.

After this patch, invoking this command from the prerouting chain:

 # nft -c add rule x y fib saddr . oif type local

fails since oif is not supported there.

This patch fixes the lack of rule validation from the abort/check path
to catch configuration errors such as the one above.

Fixes: a654de8fdc18 ("netfilter: nf_tables: fix chain dependency validation")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/netfilter/nfnetlink.h
net/netfilter/nf_tables_api.c
net/netfilter/nfnetlink.c