]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.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)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 10 Dec 2020 11:06:09 +0000 (12:06 +0100)
commitbb8c6b0a741c7cf1615d8abf16df4ba36c4de098
treed948d97b15a14dbd2e997eab8bf1a760ffeeb5cd
parent1064444bd0b40e9bc2d7063b33d15c86672b52ff
netfilter: nf_tables: missing validation from the abort path

BugLink: https://bugs.launchpad.net/bugs/1905618
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
include/linux/netfilter/nfnetlink.h
net/netfilter/nf_tables_api.c
net/netfilter/nfnetlink.c