From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.70.190.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795903529; b=CFf812+OvhXMwmydoBn2h0kdWkqsEbaakIWzXEYjE/TJminKznasRlXAIw9r+QHPGYML cKV4q6BTy7RjfSK4ix0qI7cLB/2cfjyKCTWAxoSzFy/JJT1yTMRE0HW0VZrp1ZAKJZamK UcCW8ZraAEd4P8eLs5e0gBdEvqXrsrZVj8g2xUY7UVn+KjRNhDU9QyZiK+ERUtavXasy7 KJW4UWKJiyWR48piOQRbbSaJXFPt8lDWx93fdKwkg9L4QkD/LTp0ZtiFDa2vy/vFrEMbr z0g8aQrhPrZC4VArY6JW9RbJtyU43BQ+uGD58hV7PIk2aWyiTONpnS/t7HNBzDpOU+A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795903529; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:X-Spam-Status:X-Spam-Checker-Version; bh=2zD/UHnInbAJX8C4oaoF4HYAY8nK5DQgExytRsKjTbg=; b=bNGes/fjSDI28SgPIEWfQ0ugOVHnVSjHI66FOeuYNUgPdz6tcwKn1s08I1RVP5fZjdny UDa6LO6Cwydq6SDL/D9PmT7VVZXo/ic797NUrNM9iCyv5spIGNXfjAEY/pZ4ZgKaBbgoN f5QB1n1Gdc9HTWu2a/pqgkYf77xUFj3KCBjlVfPD+TwTaZ6+xlRlR7EzklR+UhGbWv2z5 4svedJgZ0VRZhqZVDXOOsuxfF2K1nnD0FPgns6NLHOBkqWzfTnOb4CXEiGS2q1AyEzIMU n/cETiSCw0kajtYyNBQNgmNinmmgnPv/QB/OYQb/PGTcwvMgLLWD4f5QC2yjRldbLeA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=uPKEGYDD; arc=none smtp.remote-ip=217.70.190.124 Received: from mail.netfilter.org (mail.netfilter.org [217.70.190.124]) (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 UTF8SMTPS id 56CF8606A321 for ; Sat, 28 Nov 2026 22:05:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 56CF8606A321 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=uPKEGYDD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org; s=2025; t=1795903526; bh=2zD/UHnInbAJX8C4oaoF4HYAY8nK5DQgExytRsKjTbg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uPKEGYDDCLRul6xVs/C6HyHqqtP2IlAlNcI76C3EQ56qVkU4r1hnV275/VUh11n1k +UupmDn8S937VZzN53lmiydChRLq8XoArTNYWghzanetLqXIC7FYt7dRRKMttI6OEk IUo+acClPFen6RHkwQ/0B8b+sB1Xp+w2jbYQ/fcZyD3nZVFeroIUMON5tqJtLBIkOU uQI512pnkwASDZz2sjzURz8uNKPhcglh9wIUREI08gwMgYuNMRidO4e2Jwytz+YMgA FZ9g0iUoq2QS6sSPQEWVBEttEQQw92Gyw/7Lzwsiof9oR9D0d6Hem2mCAl2gXHO6LL whJCvGWJBcTcw== Received: from netfilter.org (mail-agni [217.70.190.124]) by mail.netfilter.org (Postfix) with UTF8SMTPSA id 4947E60085; Sat, 28 Nov 2026 23:05:26 +0100 (CET) Date: Sat, 28 Nov 2026 23:05:23 +0100 From: Pablo Neira Ayuso To: Harshit Mogalapalli Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sasha Levin , patches@lists.linux.dev, Jaeyeong Lee , Mark Bundschuh Subject: Re: [PATCH 6.12 002/816] netfilter: nft_ct: move custom expectation support to helper Message-ID: References: <20261125143849.205329330@linuxfoundation.org> <20261125143849.271192413@linuxfoundation.org> <4b81813c-6a7b-4a1e-bb6d-6831e2358a44@oracle.com> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4b81813c-6a7b-4a1e-bb6d-6831e2358a44@oracle.com> Hi, On Sat, Nov 28, 2026 at 10:44:53PM +0530, Harshit Mogalapalli wrote: > Hi Greg/Sasha, > > On 25/11/26 7:55 pm, Greg Kroah-Hartman wrote: > > 6.12-stable review patch. If anyone has any objections, please let me know. > > > > ------------------ > > > > From: Pablo Neira Ayuso > > > > [ Upstream commit 3679da4ad8be84cddaf40bc307fef1fe13e051ff ] > > > > Originally, the ct expectation support called nf_ct_helper_ext_add() for > > confirmed conntracks, which is invalid, triggering a splat. This was > > fixed by commit 1710eb913bdc ("netfilter: nft_ct: skip expectations for > > confirmed conntrack") which restricted it to unconfirmed conntracks. > > > > However, early insertion of expectations into the expectations list when > > the conntrack is unconfirmed leads to stale entries pointing to the > > wrong hlist_head through .pprev due to ct extension reallocation. > > > > Commit 7c9664351980 ("netfilter: move nat hlist_head to nf_conn") moved > > the nat hlist_head to nf_conn for this reason: > > > > 1. ... > > 2. When reallocation of extension area occurs we need to fixup the > > bysource hash head via hlist_replace_rcu. > > > > I'd rather not increase the size of the struct nf_conn for this feature > > has very limited scope: only one expectation can be created at a time > > given expect_clash() will make nf_ct_expect_related() reports EBUSY. > > For this reason, relax nf_ct_expect_related() not to drop packets in > > case expectation creation fails, therefore, expectation creation becomes > > best effort. > > > > To address this issue, add an internal ct helper and attach it to the > > conntrack entry to streamline the custom ct expectation support with > > existing ct helpers. > > > > Expose a new nf_conntrack_helper_release() function to release the > > internal helper that is allocated and attached to the conntrack entry to > > create the custom expectations. The nft_ct module removal always waits > > for rcu grace period, then the NULL helper callback is observed after > > this. > > > > This patch also restricts the creation of expectations to different > > helpers other than this custom helper that is created for this type of > > expectations. > > > > Fixes: 857b46027d6f ("netfilter: nft_ct: add ct expectations support") > > Reported-by: Jaeyeong Lee > > Link: https://patch.msgid.link/20260715144755.00ea7dfcd9f@proton.me > > Signed-off-by: Pablo Neira Ayuso > > [ - ac46f3f35b6e ("netfilter: nf_conntrack_helper: add refcounting from > > datapath") is not backported because it reworks helper lifetime > > around a datapath ct_refcnt in 9 files, so one static nft_ct_expect > > helper is unhelped at nft_ct module exit. > > - d4beefc90a66 ("netfilter: nft_ct: support expectation creation for > > natted flows") is not backported because it adds expectation support > > for NATed flows, so the moved expectation code has no NAT > > follow-master part. > > - Context differs due to commit: 6031487d4e27 ] > > Signed-off-by: Mark Bundschuh > > Signed-off-by: Sasha Levin > > --- > > include/net/netfilter/nf_conntrack_helper.h | 1 + > ... > > > > + > > +static const struct nf_conntrack_expect_policy nft_ct_expect_helper_policy = { > > + .max_expected = NF_CT_EXPECT_MAX_CNT, > > > I ran an AI-assisted backport review, and the finding looks correct to me. > > This backport replaces the configured expectation limit with a shared > maximum of 255. > > > In net/netfilter/nft_ct.c, upstream 3679da4ad8be gives each object its > configured helper policy: > > ct_expect_helper->expect_policy[NF_CT_EXPECT_CLASS_DEFAULT] > .max_expected = priv->size; > > The backport instead gives every object the shared maximum: > > static const struct nf_conntrack_expect_policy > nft_ct_expect_helper_policy = { > .max_expected = NF_CT_EXPECT_MAX_CNT, > }; > > The backport removes the evaluator's priv->size check without replacing > it. A size-one object now supplies 255 to ctnetlink's eviction check > instead of one. The supplied tip remains affected. > > I think we should drop this patch. No, this feature is actually broken if you run it. You cannot create more than one single expectation anyway because expect_clash() will not allow it. So no, the AI assisted report is non-sense.