🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #3085

[PATCH v1] octeontx2: Fix use-after-free of qos node in delete path

#3085
From: Binbin Deng
Date: Wed, 14 Oct 2026 06:42
36 lines
7004 bytes
hash_del_rcu() only unlinks the node; a reader that already holds the
bucket iterator still uses the node.  The immediate kfree() has no
grace period, so a concurrent transmit on a socket whose skb priority
carries the deleted classid reads node->classid / node->qid from freed
memory (use-after-free in the softirq transmit path).

Fix this by calling synchronize_net() before the node is freed, as
mlx5e does.

Found during a static-analysis-assisted audit: candidate sites were
surfaced by a Coccinelle rule, and the reader/writer paths were
confirmed by LLM-assisted (GLM-5.3) code inspection.  The issue was
not observed at runtime; it is identified by code inspection only.

Fixes: 5e6808b4c68d ("octeontx2-pf: Add support for HTB offload")
Signed-off-by: Binbin Deng <18983559317@163.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/qos.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/qos.c b/drivers/net/ethernet/marvell/octeontx2/nic/qos.c
index f160b1618efa..2ede0b84e5f5 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/qos.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/qos.c
@@ -331,6 +331,8 @@ static void otx2_qos_sw_node_delete(struct otx2_nic *pfvf,
 		otx2_qos_update_tx_netdev_queues(pfvf);
 	}
 
+	synchronize_net();
+
 	list_del(&node->list);
 	kfree(node);
 }
-- 
2.43.0
Technical Details
Message-ID: <20261014064204.291688-1-18983559317@163.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346055-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346055-linux-kernel-netdev=dewy.ru
From: 18983559317@163.com (Binbin Deng)
Newsgroups: linux.kernel.netdev
Subject: [PATCH v1] octeontx2: Fix use-after-free of qos node in delete path
Date: Wed, 14 Oct 2026 14:42:04 +0800
Organization: Usenet Network
Message-ID: <20261014064204.291688-1-18983559317@163.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2235634"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:TNxsHB6SoFb4OikXTan5uAnI2zs= sha256:gPDERSU0kw9bQUuF7vcbRqBrlnYEO74Fh6Ybt7jPQgY=
	sha1:pt/kkn1PSRXAsYvxiJdSxqAnii4= sha256:2lzQFOztKpuPNVEfzwzwMe7XutJ1WM7G6rUoyAQH/vw=
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 47E0F110049; Wed, 14 Oct 2026 09:49:50 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.415
X-Spam-Status: No, score=-0.415 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, FROM_LOCAL_DIGITS=0.001, FROM_LOCAL_HEX=0.331,
	HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=163.com
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 pJDMa36zcb_c;
	Wed, 14 Oct 2026 09:49:47 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-346055-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=163.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 02CAB10FFF8; Wed, 14 Oct 2026 09:49:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id A37A1607B9; Wed, 14 Oct 2026 06:43:26 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FE59421F0F;
	Wed, 14 Oct 2026 06:42:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="mWZxpNTI"
X-Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3])
	(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 972092F7F05;
	Wed, 14 Oct 2026 06:42:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.3
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791960178; cv=none; b=pVRzU7PeFLSNc6uuBzHPskiAWkfDTQ6KJ1eu0s4ikZf5ECT+78mMayW9s4ovfeDkPnJRJTKBA85tojMu0wvWL7yH6BM3lVR0sCmqjVpYzvhxePRXCMPAsrg8dhUbZE0L7SVScG7+nz38SKaZmokyXG5aYVJAwTir3h+d2xMAHqU=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791960178; c=relaxed/simple;
	bh=hAlukcTVlemJDMH1tcMxKsSVPOBw47EG8GguA9EFPP4=;
	h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bE4qq/OtGfZIHq0OFSVvDZme/cjK3+3wNzaV6CfMZg2xckg9W5OQcy1CoqLgh5IBbWHJ0sLBC9okH5o/3HkBA2ypJSW8uSI75Zbex/Sw7ZrsV4KZHDr2uaqUB0xx2Vwo7fpig2GRtqabsNvjdpFr5ekDeEDDg48QsBB88WquCMU=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=mWZxpNTI; arc=none smtp.client-ip=220.197.31.3
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;
	s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=iJ
	IuX/aIEU0eARygIk3MkWkpVxNtFv/aphxvSLEZSeI=; b=mWZxpNTIMjUxoOfrFb
	06nzVYU0qqVoDGRRPalAlCSTBKniqopcebub7wGx+XklXBo5XErfvZVg+rAyOZe5
	MoRjOlvhJj2uATttgOupH9H71x8yC0l0JKHr+AZGOOS4hTnJDzP1TyFM4HW6lwOj
	2uFIKMqKsij9uiwdjQgbbhP6I=
X-Received: from colol4bi5.localdomain (unknown [])
	by gzsmtp5 (Coremail) with SMTP id QCgvCgC3U3g9JM9qUVT9EQ--.44584S2;
	Wed, 14 Oct 2026 14:42:06 +0800 (CST)
X-Cc: pabeni@redhat.com,
	netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Binbin Deng <18983559317@163.com>
X-Mailer: git-send-email 2.43.0
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-CM-TRANSID: QCgvCgC3U3g9JM9qUVT9EQ--.44584S2
X-Coremail-Antispam: 1Uf129KBjvJXoW7ZFyUAry3JFWkur1UtrWDArb_yoW8Gw17pa
	1FyFy29FykJr4Skws7ta1rXr15Jan2q3y5K34Yvwsav39Yk3WfZryYkayrK34rKrWrG3W2
	qFWUAan7CFn5Z3JanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U01v-UUUUU=
X-CM-SenderInfo: jprymmytvvmjmrxbiqqrwthudrp/xtbC3x+mimrPJD9TMQAA3w