summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2023-07-19 20:19:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-07-27 08:57:02 +0200
commitb2bdf3feae26c4c61b23405567bc558b5ccb80b8 (patch)
tree72435756da8307e971ee08af1193a4b88c6777ba /net
parent48dbb5d24c667bf26bc2fea8caa7fe51fcc6aa62 (diff)
downloadlinux-stable-b2bdf3feae26c4c61b23405567bc558b5ccb80b8.tar.gz
linux-stable-b2bdf3feae26c4c61b23405567bc558b5ccb80b8.tar.bz2
linux-stable-b2bdf3feae26c4c61b23405567bc558b5ccb80b8.zip
netfilter: nf_tables: skip bound chain in netns release path
[ 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>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nf_tables_api.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index f3a4aa905487..e3049c7db904 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -10767,6 +10767,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);