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 C933B4E4305; Wed, 30 Sep 2026 16:50:46 +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=1790787048; cv=none; b=OnwKGfyBWmnJIroo2SaGXkd52J/oAm8fUdQowSlYtjaccvuOXTzNxTL4jjbb0zneTXWFOVDkit1wGmy/YQN1YpktWs/vgedGf0wbYHw0h7xhX2dI43glMwzeSBIsPRT7GJHl6jL5XhTDQPihjdMduEC0b6BC1CNzfNfw9Xvx3kY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790787048; c=relaxed/simple; bh=XB+b3xU3JIlvw6GUYzHnGdManmq73jnOsyB8vdOwZPc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SxOIo6ZXIwqMrSLdqI8c5P1B2N5keLJeZfO3dAjOr3adGDfFIvc2wbe4TfA3hT3MXRKpn74pMRgAtJenpFxF/vj1FzKg+LrLvgnU+ga0oa2ZOXYnt6GHZQ9m4nVaBYtRrVImZwuwnnM9mkg3va3QB0ZIaz/b2zyuaeBmQcJNwkw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=urv6tLOz; 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="urv6tLOz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F39F1F000FF; Wed, 30 Sep 2026 16:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790787046; bh=gAtVEEMwbk3xEMO9btKb2kjAhiaMkGrD3ja+6p3MyDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=urv6tLOzHPqtdhgAD+nbsBK6eehe3KRSMdPllaep/UeSNg68S01PXZugur6TrPG+z Z/rOIAdtIwFh9KhF6rTjNB2mjdVAiFXigPtF/7gZQs8wSDmrG8gZ4PwFFIotlnmmIu +rpCHlYRI6+AHdu57fjdXnq679CukP+VNlvKPZPY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+6cc37aba98dac721c415@syzkaller.appspotmail.com, Nguyen Ngoc Thang , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 7.2 092/457] net/sched: act_ct: dont WARN on benign flow_offload_alloc() failure Date: Wed, 30 Sep 2026 17:23:17 +0200 Message-ID: <20260930152348.035144786@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152346.024115587@linuxfoundation.org> References: <20260930152346.024115587@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.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nguyen Ngoc Thang [ Upstream commit 47abe7a5c4eb53269aca3506446f851572a059a3 ] flow_offload_alloc() returns NULL when the conntrack entry is dying (e.g. raced with a conntrack flush) or when the GFP_ATOMIC allocation fails; both are expected under load and neither is a kernel bug. This path runs from softirq on every committed packet, so with panic_on_warn=1 an unprivileged user can panic the box just by racing a conntrack flush against a `tc ... action ct commit` classifier. Reproduced with a custom repro under QEMU: a small, fixed set of UDP flows through `tc filter ... action ct commit` on lo, raced against threads flooding bare ctnetlink CT_DELETE (flush) requests. Hits WARNING: net/sched/act_ct.c:437 (tcf_ct_flow_table_add(), inlined into tcf_ct_act() in this build) within ~15s on the unpatched kernel; same setup is clean on the patched kernel. The fix itself is behavior-preserving: both branches already did `goto err_alloc` before and after, only the WARN is removed. Fixes: 64ff70b80fd4 ("net/sched: act_ct: Offload established connections to flow table") Reported-by: syzbot+6cc37aba98dac721c415@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=6cc37aba98dac721c415 Signed-off-by: Nguyen Ngoc Thang Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260915150816.36487-1-ngocthang2710.1999@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/sched/act_ct.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 370085ab6ea41..aba022969553b 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -432,11 +432,10 @@ static void tcf_ct_flow_table_add(struct tcf_ct_flow_table *ct_ft, if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status)) return; + /* NULL if ct is dying (raced flush) or the atomic alloc failed. */ entry = flow_offload_alloc(ct); - if (!entry) { - WARN_ON_ONCE(1); + if (!entry) goto err_alloc; - } if (tcp) { ct->proto.tcp.seen[0].flags |= IP_CT_TCP_FLAG_BE_LIBERAL; -- 2.53.0