]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_tables: skip immediate deactivate in _PREPARE_ERROR
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 23 Jul 2023 14:24:46 +0000 (16:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:22:36 +0000 (10:22 +0200)
commit98bcfcaecc76c4be288278c213b47d36292f40fa
tree8fa9014e10e43c9e8097f558ce3d6e1708e2bb5e
parent50cbb9d195c197af671869c8cadce3bd483735a0
netfilter: nf_tables: skip immediate deactivate in _PREPARE_ERROR

[ Upstream commit 0a771f7b266b02d262900c75f1e175c7fe76fec2 ]

On error when building the rule, the immediate expression unbinds the
chain, hence objects can be deactivated by the transaction records.

Otherwise, it is possible to trigger the following warning:

 WARNING: CPU: 3 PID: 915 at net/netfilter/nf_tables_api.c:2013 nf_tables_chain_destroy+0x1f7/0x210 [nf_tables]
 CPU: 3 PID: 915 Comm: chain-bind-err- Not tainted 6.1.39 #1
 RIP: 0010:nf_tables_chain_destroy+0x1f7/0x210 [nf_tables]

Fixes: 4bedf9eee016 ("netfilter: nf_tables: fix chain binding transaction logic")
Reported-by: Kevin Rich <kevinrich1337@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_immediate.c