Article View: linux.kernel.netdev
Article #17237[PATCH net] octeontx2-pf: Fix potential use-after-free in representor teardown
From: Guangshuo Li
Date: Mon, 16 Nov 2026 14:12
Date: Mon, 16 Nov 2026 14:12
31 lines
9354 bytes
9354 bytes
The representor private data resides in its netdev allocation.
rvu_rep_destroy() frees that allocation before reading rep->flow_cfg to
release the flow configuration.
Release the configuration while the representor is still alive.
This issue was found by our static analysis tool under development.
Fixes: 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support")
Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
---
drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
index 0f5d5642d3f7..662da7fc3953 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
@@ -638,8 +638,8 @@ void rvu_rep_destroy(struct otx2_nic *priv)
rep = priv->reps[rep_id];
unregister_netdev(rep->netdev);
rvu_rep_devlink_port_unregister(rep);
- free_netdev(rep->netdev);
kfree(rep->flow_cfg);
+ free_netdev(rep->netdev);
}
kfree(priv->reps);
rvu_rep_rsrc_free(priv);
base-commit: 2e54b3e187300893688c2c7517894f5d96732e05
Technical Details
Message-ID:
<20261116-c29ba55625-net-otx2-representor@mail.sdu.edu.cn>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364421-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364421-linux-kernel-netdev=dewy.ru From: liguangshuo@mail.sdu.edu.cn (Guangshuo Li) Newsgroups: linux.kernel.netdev Subject: [PATCH net] octeontx2-pf: Fix potential use-after-free in representor teardown Date: Mon, 16 Nov 2026 22:12:10 +0800 Organization: Usenet Network Message-ID: <20261116-c29ba55625-net-otx2-representor@mail.sdu.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2082578"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Wei7b7F70WlcsGG8JQReHKCFUOA= sha256:2M02VL6kb7so+7BQ6hrh8aFXNtC1Wu+5xZm1VEVHoGg= sha1:8c6PRtzvMEFj4N3uKVidv5ife2w= sha256:jla8SOCNKQOlhZNbpa1fQ+WwQN+rSNpmw+KBxPpA4Gg= 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 1F52E114C66; Mon, 16 Nov 2026 17:12:35 +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.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=mail.sdu.edu.cn 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 KSe7jIcW_i34; Mon, 16 Nov 2026 17:12:31 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364421-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=mail.sdu.edu.cn X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 93A58114C12; Mon, 16 Nov 2026 17:12:22 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 5B29137250; Mon, 16 Nov 2026 14:12:19 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794838337; b=BeH+9ZQ7j68wkS3zOPxjkow572k5B3dKcMAbVSPaf/MIZTuOgn12p92g3yFlUtt2s/Y6 +M9C4PsLghkMI9X6oRWmtAtPbKMCBLt0fJDVzyFs1Ao5+6KkHdNYVS/BWVoSzuCZ1xX/n Xb0xIkAoiPU4OejkR6mbej5Q7dq0Ynx6xOL+Syf8eZr5CLl7AL6JFk2itSlu1L/dMuPD7 E0l8afSEsSETNhDbrIq74ewayZqXybpz9TLwnRcvBYkt3L1KgHhiCs+EVnfjfmqzwLhZI SFE4xC/VErW45CIrozGuWppS60/zM/Vne48CNrBOF//iB1xtSjT4DnRMI/l0uQrrXPA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794838337; h=X-Original-To:Received:DMARC-Filter:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Transfer-Encoding:X-HM-Tid:X-HM-MType: X-HM-Spam-Status:DKIM-Signature; bh=957Ic7soB0BvMUR0IDN7Q95mS9l3bu3Thl755irnSdU=; b=oC/I0fe6kDTtPeVfJPkn4XaVh2IW1+AiTC+uCCk1L64o00stioJDeMTWLj9P54Ybfcvp Jw/I46Uqx47SwEyw8Mo2WlB1H4C3BlNwSXEX1J8P1MtySwTxlWS2N2I5DEEEvX0FXp8qc wRGMPv/bhVBBE5cZrHkhUnvGmCD0Lyx7IGY6qVHnwBPcgYmBYcgKJniIPHXrmJD1agZIc R6T6x/Sx9ZqMjJzAZoP9VPg8atprzUNrPKzwAYvi2ucibIIAIriEDuBv1EQPFHj2nGDBR Ysa4V81KpxZxbknyp+CSk2pERO+wCjs9eEa2r93ZXfCH50cVb+NDl+7iY0EdcbxoHFA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=mail.sdu.edu.cn header.i=@mail.sdu.edu.cn header.a=rsa-sha256 header.s=default header.b=eFPSHRem; dmarc=pass header.from=mail.sdu.edu.cn; spf=pass smtp.mailfrom=mail.sdu.edu.cn; arc=pass header.oldest-pass=0 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 DA390606A88C; Mon, 16 Nov 2026 14:12:17 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mail.sdu.edu.cn header.i=@mail.sdu.edu.cn header.a=rsa-sha256 header.s=default header.b=eFPSHRem X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=45.254.49.197 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794838337; b=38FNiAJoAGYSs0Ezj0OIKwITNrOmQlVFuTwneUKBjnybMUvpgwaEzd3xNG+A9PtC9jH9 g+MZ5ixgG93dZ+jr6MhoGLxOqSvVGuD20q6MFRJ/hGSyDJ7TrdT8T0rdkZTWedSFclp/v rcFdE5RJY9sTj4XOrzLQ6m9055j63phPZ4mHWQD1UA2tF4FIl0Bl5SLMx3uVYCaRRG9G6 6vT+PC/fnZUcdv5Zi12mLkyOJaWK6bJwL4wG8gfyA2RPxRTYkw/79moBbsemqn2EonONN N0Orrzpz0mNw3J7WZVwyRXwqzYapnCl47AHp2LUw8h8Fc2FZ4zgIFCty/qPi3eS5cKg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794838337; h=DMARC-Filter:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding:X-HM-Tid: X-HM-MType:X-HM-Spam-Status:DKIM-Signature; bh=957Ic7soB0BvMUR0IDN7Q95mS9l3bu3Thl755irnSdU=; b=FJKaAi9tv4KV3XPxqb4YshetpxChMcJf5snnEdj2X4OEzkTeawXbkHrcGN99F9c8ZAl9 hHK5gbXMJqNBh5ScXAzdXD9g6AN9/AAxctx2YRPjzTJEztJVqUWGh1uAJs2sjKNdihyA/ BVLgP+X+BL9ll6/EkzSwYpvCXz+4A48ZBFaLfCAkIYA9zp3qV8NbQOVD8XYW+uS9jCdi8 rxMl96YaOKgNlc+kyagLkdOiHyibuhWUp3GSNFWF6aiUtGGUtyFzKQxIE6uQg8uAfH4dK RFSABM4bQ/Fm7WNNYZh17ZwqC7X1rrtLjoXv3oE3adDk3sFE3oKAEGJxt8df74pV2BA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=mail.sdu.edu.cn; spf=pass smtp.mailfrom=mail.sdu.edu.cn; dkim=pass header.d=mail.sdu.edu.cn header.i=@mail.sdu.edu.cn header.a=rsa-sha256 header.s=default header.b=eFPSHRem; arc=none smtp.remote-ip=45.254.49.197 X-Received: from mail-m49197.qiye.163.com (mail-m49197.qiye.163.com [45.254.49.197]) (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 8EE0E606A33D; Mon, 16 Nov 2026 14:12:15 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8EE0E606A33D X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mail.sdu.edu.cn X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mail.sdu.edu.cn X-Received: from lgs.. (unknown [101.76.249.61]) by smtp.qiye.163.com (Hmail) with ESMTP id 54db446d5; Mon, 16 Nov 2026 22:12:11 +0800 (GMT+08:00) X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: git-send-email 2.43.0 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-HM-Tid: 0aa1e4b3803703a1kunme4496ae710dbfd X-HM-MType: 10 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVlDQ0pJVhhMGEMZHktLS0JPT1YeHw 5VEwETFhoSFyQUDg9ZV1kYEgtZQVlKS0pVTE1VSU9CVU1KWVdZFhoPEhUdFFlBWU9LSFVKS0lCQ0 NMVUpLS1VLWQY+ X-DKIM-Signature: a=rsa-sha256; b=eFPSHRemO9gAufTkq4FKTkvWr1XSX5pRYNoFuwndbXZL6WxflKTzSi/usl6oEpbuYFut1LpMZsrLISJW1tZmMwsAvFcmh0+ymGLmf0trhcJEgjtTABTuCpW2TaWOY9OPIekZxcUkyvz3MOinGuP81oU6Otad9VGfDzQ4uaypXNw=; c=relaxed/relaxed; s=default; d=mail.sdu.edu.cn; v=1; bh=957Ic7soB0BvMUR0IDN7Q95mS9l3bu3Thl755irnSdU=; h=date:mime-version:subject:message-id:from;