From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFFBC1ED38 for ; Tue, 25 Jul 2023 11:33:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3400FC433C8; Tue, 25 Jul 2023 11:33:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690284816; bh=ZwQFuQ8LsVDglOkQLF9O0K9Sdro5+MVlBN9FZhj9+OQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c6gMEli9Z/LNdOOYOcYtzB7E4TpT3pD3S8FqfPhnOFdsuXWqAllYObhTQ4a4cjakk XyPaLSRol/oAvJ5wkhTPwwuzdYrjNkblwe7t3f0wnGMILg8ay7VAKh5cfBmwj3pK/F HCQ+MoZkB3vbAxFTXWJIc0ufCSwYDbXIA6XOk/nM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pablo Neira Ayuso , Florian Westphal , Sasha Levin Subject: [PATCH 5.10 491/509] netfilter: nf_tables: skip bound chain in netns release path Date: Tue, 25 Jul 2023 12:47:10 +0200 Message-ID: <20230725104616.227969874@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230725104553.588743331@linuxfoundation.org> References: <20230725104553.588743331@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Pablo Neira Ayuso [ 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 Signed-off-by: Florian Westphal Signed-off-by: Sasha Levin --- net/netfilter/nf_tables_api.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index a8d316a58e44c..40ed4dd530c5a 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -9185,6 +9185,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); -- 2.39.2