From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 EC08251E458; Wed, 30 Sep 2026 17:31:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790789503; cv=none; b=Ki6MBFmQVXkU7DrYJTiJ2AQBYe9fih15T3EyNZF9UgMfoB8Cl16snkKIUVAwec0gTgsSoJdWPkZLqrY6GA2QqzdMF9VbLW/Jf7sQZW/FHnBDO94iHDeP55BD8XV4YZjGIAqoYsgV8KGtgPgRZDwdZIbsZ8RBp5uzCsYZFoUxLOQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790789503; c=relaxed/simple; bh=g3hief0Lv/ns3+V9Ld36RFW5vMPbiTNbAVw3x0JrMts=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cShmi22lbSKpnimZKY5zaPPzO4RDQjri5Tez5QMev1IaTiN5mjdpZnPEfS48QlKjClsxSbmARPbJBZ1aABie7MzCqvfEvEVGWB4FkApyJU0VsOhboEXQonAQXZd+MNiXBVJQ38Y9QIyzNZzI9cvsaplCNPR1HrZP3X2JMM7EkuY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Vaob0NRm; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Vaob0NRm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52DAF1F000FF; Wed, 30 Sep 2026 17:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790789501; bh=QXRBQOmNwDHRPX1uoLOEPyx3tOIIdb2k5FLrDn1WIxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Vaob0NRmSWHjyJEtQKGtK8endjlkTYSC4XtF9g41FaEUOWbBUVDUpBxqLlILf7Dn1 8KHXPuyEMij0ffpP16/AcPSDJdaVimyYJ5JEGlLumeim2Dx8T/Enhvt9BSmymQTSDy wrVDIfKd7wA2CzUWBl1yxkHi8wAc5prPVxV4DBEY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pablo Neira Ayuso , Sasha Levin , "Benjamin Robin (Schneider Electric)" Subject: [PATCH 6.12 455/877] netfilter: nf_tables: join hook list via splice_list_rcu() in commit phase Date: Wed, 30 Sep 2026 17:22:46 +0200 Message-ID: <20260930152424.497545168@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152414.738996857@linuxfoundation.org> References: <20260930152414.738996857@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pablo Neira Ayuso [ Upstream commit a6134e62dba2ea4f760b29d5226907f447c92400 ] Publish new hooks in the list into the basechain/flowtable using splice_list_rcu() to ensure netlink dump list traversal via rcu is safe while concurrent ruleset update is going on. Fixes: 78d9f48f7f44 ("netfilter: nf_tables: add devices to existing flowtable") Fixes: b9703ed44ffb ("netfilter: nf_tables: support for adding new devices to an existing netdev chain") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin Signed-off-by: Benjamin Robin (Schneider Electric) Signed-off-by: Sasha Levin --- net/netfilter/nf_tables_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index af9df95ddf055..0aa96283385a6 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -10360,8 +10360,8 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) nft_chain_commit_update(nft_trans_container_chain(trans)); nf_tables_chain_notify(&ctx, NFT_MSG_NEWCHAIN, &nft_trans_chain_hooks(trans)); - list_splice(&nft_trans_chain_hooks(trans), - &nft_trans_basechain(trans)->hook_list); + list_splice_rcu(&nft_trans_chain_hooks(trans), + &nft_trans_basechain(trans)->hook_list); /* trans destroyed after rcu grace period */ } else { nft_chain_commit_drop_policy(nft_trans_container_chain(trans)); @@ -10513,8 +10513,8 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) nft_trans_flowtable(trans), &nft_trans_flowtable_hooks(trans), NFT_MSG_NEWFLOWTABLE); - list_splice(&nft_trans_flowtable_hooks(trans), - &nft_trans_flowtable(trans)->hook_list); + list_splice_rcu(&nft_trans_flowtable_hooks(trans), + &nft_trans_flowtable(trans)->hook_list); } else { nft_clear(net, nft_trans_flowtable(trans)); nf_tables_flowtable_notify(&ctx, -- 2.53.0