Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75AAF1F0089A; Tue, 1 Dec 2026 22:45:21 +0000 (UTC) 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== Subject: Re: [PATCH net 01/10] netfilter: conntrack: prevent helper extension relocation From: netdev-bot+sashiko@kernel.org To: pablo@netfilter.org 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 Date: Tue, 01 Dec 2026 22:45:20 +0000 Message-ID: <179616512099.3146.14146314326211595367@kernel.org> In-Reply-To: <20261130215141.1009148-2-pablo@netfilter.org> References: <20261130215141.1009148-2-pablo@netfilter.org> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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