summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2024-02-19 16:58:04 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-01 13:16:51 +0100
commit31ea574aeca1aa488e18716459bde057217637af (patch)
treeb640009b3cbb5eedcf755afab6fefb8bb32e95f5
parent31e10d6cb0c9532ff070cf50da1657c3acee9276 (diff)
downloadlinux-stable-31ea574aeca1aa488e18716459bde057217637af.tar.gz
linux-stable-31ea574aeca1aa488e18716459bde057217637af.tar.bz2
linux-stable-31ea574aeca1aa488e18716459bde057217637af.zip
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>
-rw-r--r--net/netfilter/nf_tables_api.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index f586e8b3c6cf..73b0a6925304 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1132,6 +1132,7 @@ static int nf_tables_updtable(struct nft_ctx *ctx)
return 0;
err_register_hooks:
+ ctx->table->flags |= NFT_TABLE_F_DORMANT;
nft_trans_destroy(trans);
return ret;
}