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 3F8AF42668E; Wed, 30 Sep 2026 19:35: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=1790796942; cv=none; b=QcS2LJiCystcWc2WWJeVz9YcGnSaGmfM7Jcpx2f2TsFNCNVXodnbWukysqs/5Q+jYngxFy3s1qYDg2q/MTCFb9hMuetiS08c82tEFPHQMgSSqYn+bgDNYOgKD/5xIsX6sPcyKkWtf3dhLRO5Ru1zV50Ixw9ibFeSlMSMsFGyC8U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790796942; c=relaxed/simple; bh=Z7R+k3e2doo+g+5Ooh5WwEPNmTSxxYKGSEQ2XithjhY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kWNOlfUy4z84Aj+oXWv66xqTGASQVlySnuiTxabLoJW0mfP2ucLeD87mSiSeC2o1JSe4loRYVijP6AO9OED2y0/do2+MlO1nUm00fFpGDraSPs0v5thQvfsg4FqlDjYdR5bvweLV/HF+0YYrQeEZ144BckMsDXv5+Lchai4x3h0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FBm4D4Vl; 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="FBm4D4Vl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A95B1F0089C; Wed, 30 Sep 2026 19:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790796941; bh=UNrkrzf4QU5WWwLBr9Snra5NY0Je/6JAz9nHgeC2TDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FBm4D4VlQR02uKc5Cb3U5YnT6hTEtaJNk0nh0KPd3O3fnqj+/g0r1wCiFfY6vBicJ 5BA4OzORRUmGYhDvZD5uuco2R1NlBOyULhRLdQXLBr4gbbZCVNhw5bfb1R9LgVcxfo 2kQxWiK2K8MPNE+05SSDxfj7xrKwQz6M7pd4wQKo= 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.6 1089/1193] netfilter: nf_tables: join hook list via splice_list_rcu() in commit phase Date: Wed, 30 Sep 2026 17:29:33 +0200 Message-ID: <20260930152458.428480662@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152434.301151190@linuxfoundation.org> References: <20260930152434.301151190@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.6-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 81d67a4ae8765..9807248cf38de 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -10298,8 +10298,8 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) nft_chain_commit_update(trans); nf_tables_chain_notify(&trans->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(trans); @@ -10439,8 +10439,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(&trans->ctx, -- 2.53.0