]> git.hungrycats.org Git - linux/commit
netfilter: nf_tables: set dormant flag on hook register failure
authorFlorian Westphal <fw@strlen.de>
Mon, 19 Feb 2024 15:58:04 +0000 (16:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:26:37 +0000 (13:26 +0100)
commit0c9302a6da262e6ab6a6c1d30f04a6130ed97376
tree4d8e9078ddb5cd48265037f928b30c4fb7eb6ea2
parentbdaf6bbfc1f231bacc22d222d830b9dc817d7d23
netfilter: nf_tables: set dormant flag on hook register failure

[ Upstream commit bccebf64701735533c8db37773eeacc6566cc8ec ]

We need to set the dormant flag again if we fail to register
the hooks.

During memory pressure hook registration can fail and we end up
with a table marked as active but no registered hooks.

On table/base chain deletion, nf_tables will attempt to unregister
the hook again which yields a warn splat from the nftables core.

Reported-and-tested-by: syzbot+de4025c006ec68ac56fc@syzkaller.appspotmail.com
Fixes: 179d9ba5559a ("netfilter: nf_tables: fix table flag updates")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_tables_api.c