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 1C712372680; Wed, 30 Sep 2026 15:57:38 +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=1790783862; cv=none; b=ZL5GNRZ/yyFl65d8SNd2go/isfP0zHgjqnLw6A9GirHV8e9QwlFADV0Nd25U0GOc3qldVQ5BlDpRkTiPu5D/AkFVBM5Qx8WmfUVzBJGKsKLQgRpuWMT3NTsBEzDkB2xsUZqDsBLviDTrGtWeH5eXK3CIlSsyUTY3R3oHb9U0Ukw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790783862; c=relaxed/simple; bh=NFJivmW93sTAzuBAFUQiq1oPPbkvwT9Z/oWp3jP1SSE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CRsl/j8nZDGPv92isnFuOhtY7B3IG748rsTfW8ylFMtPvhhP0/T0e2rzjbFQ+trU14rjEF/92X7RjEe3FEhdGqQqNKGHxi6Wz0e1e5IMF42v4aKfhE1/kOq0kIgKq0qm/5qvS8eQOJt5XriKcT4g/Qm2q1Y3vTBrVHAEqMxs8Kg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EkGxge++; 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="EkGxge++" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEE4E1F00893; Wed, 30 Sep 2026 15:57:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790783858; bh=xljDn+Rn1z6Im2b6OJNrXaE1MOLb89+gQVUlWWg1a5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EkGxge++hJgAiZQHvIMCUl+iHZtPSrYnGjiqwGkwczqlLuKOcgWMrD3+SpnNWFfZW VBVnA10Mb6kGs4zKNSxcULHYYmVzY6UNRYcy0NXFpHi40EKzu9JHIlc+zAaBl6Vpif k01jk19TfpqmxEL+GtC8zMxXA8+SpqN0Z6wZV99E= 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 5.10 502/595] net/sched: act_ct: dont WARN on benign flow_offload_alloc() failure Date: Wed, 30 Sep 2026 17:26:35 +0200 Message-ID: <20260930152358.495364707@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152347.700140858@linuxfoundation.org> References: <20260930152347.700140858@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 5.10-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 adb421684440a..64084162b2834 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -375,11 +375,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