๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25496

Re: [PATCH net 01/10] netfilter: conntrack: prevent helper extension relocation

#25496
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 22:45
85 lines
11227 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The commit message describes a use-after-free path that the
  tree no longer has.

--

netfilter: conntrack: prevent helper extension relocation

When nf_ct_ext_add() adds the helper extension, it now reserves enough
room for every extension type, including alignment padding. Later
extension additions to the same unconfirmed conntrack then cannot move
the extension blob. The goal is to keep an expectation's lnode.pprev
from pointing into freed memory.

> An nftables CT expectation object can link an expectation before a later
> NAT expression adds extensions to the same unconfirmed conntrack. If an
> addition relocates the blob, the copied hlist head still points to the
> expectation, but the expectation's pprev continues to point into the
> freed old blob. Removing the expectation later executes hlist_del_rcu()
> and writes through this stale pointer.

[Severity: Medium]
Is this description still accurate for the tree this patch applies to?

The baseline already has commit 3679da4ad8be ("netfilter: nft_ct: move
custom expectation support to helper"). It carries the same Fixes: tag
(857b46027d6f) and has the same reporter.

After that commit, nft_ct_expect_obj_eval() in net/netfilter/nft_ct.c
never calls nf_ct_expect_related(). It only adds the helper extension,
stores the parameters and attaches the internal helper:

	help = nf_ct_helper_ext_add(ct, GFP_ATOMIC);
	...
	expect_data->obj = *priv;
	expect_data->obj.helper = NULL;
	expect_data->dir = CTINFO2DIR(ctinfo);

	if (help && refcount_inc_not_zero(&priv->helper->ct_refcnt))
		rcu_assign_pointer(help->helper, priv->helper);

The expectation is now linked only in ct_expect_help(), which runs as
helper->help():

	if (nf_ct_expect_related(exp, 0) != 0)
		ret = NF_ACCEPT;

Every caller of helper->help() runs it after all extensions have been
added:

- nf_confirm() calls it right before nf_ct_seq_adjust() and
  nf_conntrack_confirm().
- tcf_ct_act() in net/sched/act_ct.c calls it after the comment "This
  has to be done after all the extensions are already added".
- net/openvswitch/conntrack.c calls it after the comment "all the
  extensions must be allocated before the call".

None of these paths seem to call nf_ct_ext_add() once the expectation
is linked. So the relocation of a linked expectation's pprev described
above does not look reachable through nft_ct in this tree.

The change still looks reasonable as hardening, since it removes the
ordering rule between extension additions and helpers. On older stable
trees without 3679da4ad8be, it would also close the original bug.

However, the message describes a live use-after-free and carries
Fixes: and Cc: stable tags, but it does not mention 3679da4ad8be.
Could the message say how this patch relates to 3679da4ad8be? For
example, is it a second fix for the same bug, an alternative backport,
or hardening? That would tell stable maintainers whether they need one
of the two patches or both.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130215141.1009148-2-pablo%40netfilter.org
Technical Details
Message-ID: <179616512099.3146.14146314326211595367@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375389-linux-kernel-netdev=dewy.ru
References: <20261130215141.1009148-2-pablo@netfilter.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375389-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 01/10] netfilter: conntrack: prevent helper extension relocation
Date: Tue, 01 Dec 2026 22:45:20 +0000
Organization: Usenet Network
Message-ID: <179616512099.3146.14146314326211595367@kernel.org>
References: <20261130215141.1009148-2-pablo@netfilter.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1835674"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:VUr1mwlpq2mRIIfNeAdhafIBgZY= sha256:O9Bhf9mfz1yEi9xU6sa294OHqc0VxxC2cbSy9ojvM8E= sha1:B6ek8C1KtB/gIVevnj6MqL3MwjA= sha256:eMpeehyyVPKnio1Ye2vhjYyb4+SzTl4Eblwz1oEwPfw=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id AF2621174C9; Wed,  2 Dec 2026 01:45:38 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZJTqQeu2LYbQ; Wed,  2 Dec 2026 01:45:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-375389-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 12B9F1174C6; Wed,  2 Dec 2026 01:45:25 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 499FF603290; Tue,  1 Dec 2026 22:45:25 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796165123; b=qZRQ8xtXbJkn6NrcTpyvAMQQ+np4bG4cr5k2rmQVanyO9ulXWvMFnI1XMlDTo8vU4lJD G3+leZ2V/2qY9AU5RutfWGIvSJVuBVNgEYUboI7QRpA8IaO9OFfzeOgGtFPvOllRme+VS P0gj1DZdPg0dfWzF+c0PKnnALfU218TbqhmmE6kEvyl6Ff/n075/PTehlev5UQ3I/QyBm PtqSR4ddlsnCWBaSNwXsbyV+SgthRRWgtR+uWHgwHhfK35KKzFPUoZRLS864SMhUzpDhl YHn3/Lp9Uka6WSJKGbqgiyGJ2cwkx9eeiRHmL6DlzcOZmTAVKMHWMz/hoD5MhFwEpxA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796165123; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=c4FNx5oltuOld8wB+YoSdDQqqGzfuQFgCmIGFVsxm4g=; b=dLtZYe53TrUEWiMcHSAoVh1xldPbqvRbHxA62ZCa1nwpV017oJ4PwXittQ5UqURGhkG3 3zSGdpQrj8BjPMQJL9dMsYcD74Qb1GOzDoNA64Wof0hprHM4FEQFKqNqY49g6NwU1j29W /SAQbVSAUFmvy7cBGZs3uZz/eEKTx2ZIn14PuAb9UYncxRzK+KgYbb6ONVRmSl2/hmsgD 7FKr70VrvCUupJqDr0ppbtp/JMKa1NTBi3sonhzO8gjx1ex1vm+q3aBa/jdPChe5qAK1B 7yoz2AuXab5GdQxhIWCseu9qBy938WJl81JSbLQKtCu0e/bDpMQIPvCfjCvj4XmR46A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LCcuBPyx; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A305606A331; Tue,  1 Dec 2026 22:45:23 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LCcuBPyx
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796165122; b=PcjphkjUBa6nDyrV73BfgcNvtUDWEy5jWNfuyY+FQG7HUry91ACy3X/xtN2EFN4pguUk j1SwzJsPDsikUTyJMx5s0x7b5yXrUewhX2yDLwPlS8rGH8Zw09X4x+MX/WI7QAQggo8me /ZKQQER2/k7qKJIPVETd6GrBQjO9pPHR94De5+P0SPnDbhb2g77oV7KD/J6VxsnVskHiC lvMoruXe5BOF4aPnQxXTLGxh2H4ir5OOU9jzhqxOufoSZ+eZLO03fEahveXN5smUSibwo ZiCcFIMA9FLDOlqRvdOAXyrN+nHnWoW3xBQqEkZh+VNI7PN9rT4ESveosNIYU+FQHVA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796165122; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=c4FNx5oltuOld8wB+YoSdDQqqGzfuQFgCmIGFVsxm4g=; b=WeK3OCyMn//yUOJAHhcfQpXyF298/A1tBA1E5CZgrucxcIrKEhOokrBZaQvt/1P/c5VE 4xjU1LKuK1HVs3e/9AO9vlryJcjR1Yu2hayAlIeKKDy/ZcPgFTHcw6hGv2mq1awmGSEY3 WQoqmUquXDcLX7gPyYTvdytHcp3EEZ5F1+/1O/pfAWQ/lbTLUeLfZYg2P35ZaLSqATQLI 0EcvCrjxTb0ddqzgKB5bAthUmWU92qm7DboKqXMDh2dXpvQ6fnkelB5gLYskEIbArxHIe HWAF2azPLSSVbUb7uaTyMyneUWq2kRZPQ31j25RwuDHywHKU1X8aAxImW7IQ4udtvJw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LCcuBPyx; arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29D26606A322; Tue,  1 Dec 2026 22:45:22 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75AAF1F0089A; Tue,  1 Dec 2026 22:45:21 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796165122; bh=c4FNx5oltuOld8wB+YoSdDQqqGzfuQFgCmIGFVsxm4g=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=LCcuBPyxwbDxWkvH4OAmtK5CLBjQqlolakAgpxDdgNLbh0W5Aex2qKZgIcfBITFvU 5bL/Qmef12RkGp78XvoYGS/RU+rhpELHTIfp9gjqYo2cEWT43PAa/55c1jWOk3cfyv 5M8RJ/DVT1+pVqLwhqmugwBr9vDbf3pojMhzFH6S/kOWkLAGAisOUGuUiv/5dhA8XO S6ntRi/lmVYaVad5xo/eiidtS7DTu1CIe13KfmBXjoFACOwe44TNvNSRyNPjw+Vbdj s5Y8LUfY3tuAveqrOB1iuEl4O4WKx0cUKfwJaHjDRgQOd03oPuei7MuCG8J/fdtqwi 4AinvFeNFwDXw==
X-Cc: netfilter-devel@vger.kernel.org, davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, horms@kernel.org, fw@strlen.de, ja@ssi.bg
X-In-Reply-To: <20261130215141.1009148-2-pablo@netfilter.org>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list