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 5A49B3EEAC6; Wed, 20 May 2026 17:05:01 +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=1779296702; cv=none; b=VgjoTj6biLjl/Wqm9kIQabIuBGJcofRhRiby5x0cjmtT7JibYAW1rzsyWra7AmjpOsTClxl58zTjPWLP57Zby/lPswuFBCsTzAIM+8P+GaHThgyAGwRJGa3Ewgcf/g4BOiupZXigdr3SnEUC5O5gzNN/QoR08dFqQb4D6srD/eg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779296702; c=relaxed/simple; bh=44gwZxJ2qOCGKlnXQrN36eTi0p7JjUzpUnhSBL96iq0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q0LySHi2DmglLg5vev/X1fzapoEWnyYMdxTW6ODhsmn8hGWdPTYFxOZ/GJkp07JktGooyfaI7FOnNf53Ha60tjdQICnUDh8Zoa/8TjXJZ5Gtchro4TmTV4Un9CPfaR+HdoUUUVX0Xze+p50nakSUClPbyXMqUUmgkJkhzv4rtAs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=H/pBFdx7; 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="H/pBFdx7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0FB61F000E9; Wed, 20 May 2026 17:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779296701; bh=nCGx4LEdoKzU7fTBq7zTKUgK+4V9b3lZrKfb6aj8Zp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=H/pBFdx71Yz0Udtv0OyPdxAGWmWKZzleNw6gCFFdc2AqUo0l5a36mEf+X3vcdZAyO /75s7uCXD1iFpO9pc15d1TzJQIfuHtc4zBIIbu1oKGO6QLZ3LHIjtk6kqgYts7Rz1A UehVpjHAnb29cd4Ax3rokieRIqUpyHxiBhz8TxyA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 7.0 0898/1146] netfilter: nf_tables: join hook list via splice_list_rcu() in commit phase Date: Wed, 20 May 2026 18:19:08 +0200 Message-ID: <20260520162208.557850487@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162148.390695140@linuxfoundation.org> References: <20260520162148.390695140@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 7.0-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 --- 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 090d4d688a333..8c0706d6d8873 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -10904,8 +10904,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)); @@ -11034,8 +11034,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