🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #8014

[PATCH net 1/2] octeontx2-pf: fix skb use-after-free on ipsec transmit drop

#8014
From: Nicolai Buchwitz
Date: Tue, 27 Oct 2026 19:54
29 lines
9364 bytes
When an SA is removed while packets for it are still queued, the
transmit path frees the packet but reports the queue as busy. The stack
then requeues the freed skb, and the DMA mappings leak.

Fixes: 6a77a158848a ("cn10k-ipsec: Process outbound ipsec crypto offload")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
---
 drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c
index 77543d472345e..3920cd0985831 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c
@@ -1037,6 +1037,9 @@ bool cn10k_ipsec_transmit(struct otx2_nic *pf, struct netdev_queue *txq,
 	cn10k_cpt_inst_flush(pf, &inst, sizeof(struct cpt_inst_s));
 	return true;
 drop:
+	otx2_dma_unmap_skb_frags(pf, &sq->sg[sq->head]);
+	sq->sg[sq->head].skb = (u64)NULL;
+	atomic_long_inc(&pf->hw.dev_stats.tx_discards);
 	dev_kfree_skb_any(skb);
-	return false;
+	return true;
 }

-- 
2.53.0
Technical Details
Message-ID: <20261027-nb-otx2-ipsec-tx-fixes-net-v1-1-2114c4f10c36@tipi-net.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352594-linux-kernel-netdev=dewy.ru
References: <20261027-nb-otx2-ipsec-tx-fixes-net-v1-0-2114c4f10c36@tipi-net.de>

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-352594-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 1/2] octeontx2-pf: fix skb use-after-free on ipsec
 transmit drop
Date: Tue, 27 Oct 2026 20:54:06 +0100
Organization: Usenet Network
Message-ID: <20261027-nb-otx2-ipsec-tx-fixes-net-v1-1-2114c4f10c36@tipi-net.de>
References: <20261027-nb-otx2-ipsec-tx-fixes-net-v1-0-2114c4f10c36@tipi-net.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1620140"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:30ESmcJQyM2di05ILYqXLY26SDQ= sha256:F4sniA0FqKl9TixOfDlnSUJE7WeSW2CQG+kB7yg4F1E=
	sha1:DUnvXJ9q2xmYL6VhFp0po8j30X8= sha256:XI7SpvViDpSqk12xQoD9nP81MUFM8jI4XIxNS54HUTY=
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 8AC16125C15; Tue, 27 Oct 2026 22:55:04 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 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, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=tipi-net.de
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 RkMLvarXNltw;
	Tue, 27 Oct 2026 22:55:01 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-352594-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 93F2B125C0D; Tue, 27 Oct 2026 22:54:52 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 911812E4EE; Tue, 27 Oct 2026 19:54:36 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1793130875;
	b=v3+N+FJ2EOJxQP2e9pTidLfEC/H6dXrrkvkFWbhN1POqZVv1mkqpAPKpFkt50fAqQWsw
	 PW8fGhQNNpaI+qpi9E26eQH6wafW2Wz7oO4nvVwv4+v0MRdNafmBaNjWeeKawMRwM1ZDn
	 0y2E1nbEQRE4ipxOsPMyczECLPg/fwPbGwmj3AcSfiUaM46IpIuJQXf8whV1UpdpfDvA5
	 IASP+B5S+iqZU2pV9q+yP4btHsLeZP+tPQp2d3oeEvh0zj6nrMNiFk4cnukC3cjE4slwv
	 PEoCzEkvzZL3H9rhho536PF5vpDlgBhkOve5iCgG/fyPl9wpcYr8jGGk+T6ZHPxoFEQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793130875;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:
	 Date:Subject:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:Message-Id:References:
	 In-Reply-To:To:Cc:X-Mailer:X-Last-TLS-Session-Version;
	bh=uMUAvH+gylo3aGfBUzHy5/oge2cBB7PCRzSrhUkZMmM=;
	b=21xHJhVPM4pQMMk2p1I3cB7waXIaPWrWi1LTWb6zOy8r4hx5XqHRWFE6/YjQGmOripaB
	 fkGtYXAwf7UmMgU7iyHHPTthgwnfVryvPC7ejKNDamP2JwvJmkH6Tbr76Ghiby7Y4VOs5
	 x3fUDgtgKhbvsZmZGi7mu1LribNhxhnjCOvIqV1aurn92mvlTQ8lPIzXc8tKzUrym9lsY
	 EtM1kZbRpGjtfbv3sm0khoMWzUF7BUVG5dikKbC5cA/KR8vV00El3bM4QobFwxdmFy5eo
	 Jal+lf1Pjli04b9mZQev+IQkRrdnFbq6AZITI+pCieg+d8CQezSnErdWhgO7vL+z/cw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=VQVXz5Fu;
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	arc=fail smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B250606A33C;
	Tue, 27 Oct 2026 19:54:35 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=VQVXz5Fu
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793130869;
	b=ASM81FuYSj5uJGoUtgCt8/oWrt/vvh6FlUJyRgULULgbLLo6OUWEZNY+zwQenpnmIEIu
	 PzBw7UKH4pQr9MSIU0qCWpcdYWfq2wcAlJKGQFiQYyIDCsRe/dduJcAP2VCAXd6SEoIY7
	 0sRCSli2GvYpJmrrOrho1BHETtr+Cue9gpEeHx3+5ozVgvmqU6ZdBYRzKbguOGwKqha+C
	 0yP2GPnzpwF3xguaKv8V63ajJ7xBJomI8FTUDTi4cG21orPPBPY8XQBBz2Xs79SAsP6AU
	 o+rPlssgMJBHz4pslAA3CIGQ7pGXeVJHt5Z5fAgNtmZsOGp2cW/gFomLuxy5kTPE2Ng==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793130869;
	h=DMARC-Filter:Received:DKIM-Signature:From:Date:Subject:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:Message-Id:References:
	 In-Reply-To:To:Cc:X-Mailer:X-Last-TLS-Session-Version;
	bh=uMUAvH+gylo3aGfBUzHy5/oge2cBB7PCRzSrhUkZMmM=;
	b=MQdBMFBQ4Hq67jdsWfeKbOF+cw+ZUewlCD8v0ik+3vzJMNu4IrUUfD84/ZJblkVPYpdu
	 WCBYTxCdQUWXkD8my17kG5ARtau/lH7LeLVGz+lir9e4tiHtEypZQWCXMW3NM/Q8l/5oj
	 XqDXqsUgqYlBvCMWOwRW0I+2RwOe2YksfeWWmVWmBW6Ae0fj+b8yi2Tkaj4juP+XnoheU
	 1fHObPbK4+Uu4RhRIdru3BkCOwWpKFsRQlHoncrDX562fC+513lagafkpl9TmkgoUHUty
	 hlqoDsq5Qm4fagTKzcnJa/6vKcYdWr/0y1BWg/qQQZjuL4hETMl9ZPR0+kf804zfHqg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=VQVXz5Fu;
	arc=none smtp.remote-ip=194.13.80.246
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B67A606A31D;
	Tue, 27 Oct 2026 19:54:27 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6B67A606A31D
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de
X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 18BFBA50BC;
	Tue, 27 Oct 2026 20:54:25 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1793130865; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding:in-reply-to:references;
	bh=uMUAvH+gylo3aGfBUzHy5/oge2cBB7PCRzSrhUkZMmM=;
	b=VQVXz5FuGAGcIWC6YCwdDF3Y3xmzAneEvnasNs+h3ctScrS2LFNoTCZh0X1ruVwIXleDXc
	UyRmv9MVHA3ah/hTYTBtvw3ycDv/hphsV+Xhc8WILhpKdV5RZD62uM0cz18d1M55K1lE91
	L6LVY0sZo7tbNAZwcoHTc+HILYcXXlNuGhdSxZfecH2crCNR5hpcO5pLFBchDSc6EDKWXA
	dduZ37rESV8cPbgGa23dwwqFSTiM2b05IqhjrY8LSCPv8anKibHzMjjvwH/GrEXQCZyX/D
	fTxfV93hdq8sQGjYN3036SptVAzXO15FUZuOhXjg8bCwrLhgKOJ/cdFts3i+4Q==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261027-nb-otx2-ipsec-tx-fixes-net-v1-0-2114c4f10c36@tipi-net.de>
X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 
 Nicolai Buchwitz <nb@tipi-net.de>
X-Mailer: b4 0.16.0
X-Last-TLS-Session-Version: TLSv1.3