]> git.baikalelectronics.ru Git - kernel.git/commitdiff
netfilter: nf_tables: skip bound chain in netns release path
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 19 Jul 2023 18:19:43 +0000 (20:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2023 06:50:46 +0000 (08:50 +0200)
[ Upstream commit 751d460ccff3137212f47d876221534bf0490996 ]

Skip bound chain from netns release path, the rule that owns this chain
releases these objects.

Fixes: d0e2c7de92c7 ("netfilter: nf_tables: add NFT_CHAIN_BINDING")
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/nf_tables_api.c

index 0bb1cc7ed5e99337471572f1ec1cace7e6b61583..f621c5e48747be4f1e9a79b7ea06476b96d1850e 100644 (file)
@@ -10398,6 +10398,9 @@ static void __nft_release_table(struct net *net, struct nft_table *table)
        ctx.family = table->family;
        ctx.table = table;
        list_for_each_entry(chain, &table->chains, list) {
+               if (nft_chain_is_bound(chain))
+                       continue;
+
                ctx.chain = chain;
                list_for_each_entry_safe(rule, nr, &chain->rules, list) {
                        list_del(&rule->list);