🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13087

Re: [PATCH] net: ti: icssg-prueth: Fix device_node refcount leak in prueth_probe()

#13087
From: Xiangwu Lai
Date: Mon, 09 Nov 2026 08:37
46 lines
10863 bytes
Hi,

Please find below the additional information netdev-bot requested
for this series.

How the issue was discovered: manual code inspection of the error
paths in prueth_probe() while auditing the driver for probe-time
resource leaks.

Whether the issue was actually triggered: no, it is purely
theoretical. The affected branches only run when the "ti,mii-g-rt"
or "ti,mii-rt" syscon regmap lookup fails, which happens only with a
malformed or incomplete device tree. On a valid DT these branches
are never taken. When they are, probe() fails with -ENODEV and the
of_node_get() references taken on eth0_node/eth1_node earlier in
the function are leaked silently; there is no stack trace or error
message pointing at the leak itself.

Hardware the change was tested on: none, it was not tested on real
hardware. The change only re-routes two error branches to the
existing put_cores label, which is already exercised by the other
failure paths in the same function (e.g. prueth_get_cores()
failures), so no new cleanup code is introduced.

Regarding the Sashiko findings:

- The leak in the SR1.0 sibling driver (icssg_prueth_sr1.c) is real,
  and it is fixed by a companion patch submitted at the same time as
  this one:

  https://lore.kernel.org/netdev/20261030085851.2019-1-laixiangwu@cmss.chinamobile.com/

- The port-node loop issue is acknowledged as pre-existing and
  separate from what this patch fixes. References taken inside the
  port scan loop can also be lost on unusual DT input (a duplicate
  port reg value overwrites eth0_node/eth1_node and leaks the
  previous reference, and port nodes with a reg value other than 0
  or 1 keep a reference that is never stored or released). Fixing
  that requires a wider rework of the port parsing logic, so it is
  deliberately left out of this patch to keep the fix minimal. I
  can send a follow-up patch for it if reviewers consider it worth
  fixing.

Best regards,
Xiangwu Lai
Technical Details
Message-ID: <20261109093000.54321-laixiangwu@cmss.chinamobile.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-359135-linux-kernel-netdev=dewy.ru
References: <179335079339.3327.14537748743173383861@kernel.org>

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-359135-linux-kernel-netdev=dewy.ru
From: laixiangwu@cmss.chinamobile.com (Xiangwu Lai)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] net: ti: icssg-prueth: Fix device_node refcount leak in prueth_probe()
Date: Mon,  9 Nov 2026 16:37:06 +0800
Organization: Usenet Network
Message-ID: <20261109093000.54321-laixiangwu@cmss.chinamobile.com>
References: <179335079339.3327.14537748743173383861@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="311393"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:CJKc3FJYoMzM2wDEDrogPz9RKrc= sha256:pPo+15qCWKYJoJV/BX68N/+xItf/SJZNcGW69Qf5CoQ=
	sha1:0FQGuds7ceu7Cmg9lvPu3ht4k3U= sha256:6vVTeVr3PZvHPm0cpa9gbxNV0YZ1QRY3qpORja4jR+c=
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 830B511374D; Mon,  9 Nov 2026 11:49:51 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.751
X-Spam-Status: No, score=-2.751 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1, DKIM_SIGNED=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]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=fail (1024-bit key)
	reason="fail (body has been altered)" header.d=cmss.chinamobile.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 lEq27FVa1MDb;
	Mon,  9 Nov 2026 11:49:43 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-359135-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=cmss.chinamobile.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 9581E113748; Mon,  9 Nov 2026 11:49:33 +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 6D213103821; Mon,  9 Nov 2026 08:38:16 +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=1794213475;
	b=qlX3IVvbB9vR6n4+a7TrDmuGBp7ynQM0t2fmXDHZUYQvgURIqgeWsfaC02x8piw5ezvu
	 IkAYZybYISVhUwvJjybItrdxvYX9XQXitOrUoOSHDTikxyRd/LONN9VBTihRA5ntj8aaj
	 qzQX6+xMEG9YVCj2bTju3sfu9juWx4lIJv71XSwlGimtQswK3sS259mPTxuTNvJAiDiax
	 +AKMIFfkm7uFWdYL3Y3ShUiH7ZQi1s9J1FVVVAaAqpmqBzTts0AU5goyxSnOs9dNhKtBi
	 7tCWLGKd7ndtfJswOG9z7dFfFmcjHpVjkgtP2SPi/Jh9pYFrCrnFy870RhC4cfz3Few==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794213475;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:X-RM-TagInfo:
	 X-RM-SPAM-FLAG:Received:X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:
	 Received:X-RM-TRANSID:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 In-Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=0Fyj5xlPc8azC7Nb28RFnfz3cVM+uNyzYf8DL1GWdVM=;
	b=K4puZOofvACfPYYjiDuxrDWEC/y18mchuKS+Alxk0VNBzCC3kEqwbx6uHVTG+ipxBIgk
	 rzuwaGw2lr2XBldcKphW1QPuuenZUyKCBqWZPzuW6HI1/sS++awsmrvD0ekzcdqbV3Meh
	 D0dGoyG29io5GADPabu+3fpUHldCBei+lilFD3X9q031pcSXbFxIuHyG7+OlYkOX3cOnA
	 AjEpYXaODQKtlv6iwjFlP2a5UGp2OQBo6q2a4SJrJ14lojGW+KN1IWg4JtSBAWerxxd/W
	 efTyBmQC1LwvkF/Xv5ObOtVAlE1AryrykcoiH+Ahv8EfpRP6ZyaR9IKvCh0hY4foorw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=JkW6qP7a;
	dmarc=pass header.from=cmss.chinamobile.com;
	spf=pass smtp.mailfrom=cmss.chinamobile.com;
	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 2A794606D801;
	Mon,  9 Nov 2026 08:37:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=JkW6qP7a
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=111.22.67.137
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794213469;
	b=FVG/1FQznU43a8Q3uq3JAx6zq+6g3VoPn/HGD5b8BLzHb1caDwpeIj5zTINClvmLMVBD
	 qBP46CgGGIipExgJ/avj6XnPUbb3StoPOtAqfKyBt1FDt4H0hJuvN2e/vDzjNxVaPZ4ss
	 4rZPBleNhDJ1+aez+HHxrGswnJzYLTox7OrqvdnPNGoE5aYoMO604jHb+LYeZYaSuPImc
	 35fRyr3I1rUUwMbL6090KFwNnNUbG7QtF9Mt0Am2iMmSnRhojmH7S2ztTYPuM3oa2YGEi
	 sKEwbx7MTR0Sjztmru3/fM7aUyDqrrktSdrxy8VuQDLKlFazusnBe+uUCkvbNjna/wA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794213469;
	h=DMARC-Filter:DKIM-Signature:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:
	 X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:X-RM-TRANSID:From:
	 To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 MIME-Version:Content-Transfer-Encoding;
	bh=0Fyj5xlPc8azC7Nb28RFnfz3cVM+uNyzYf8DL1GWdVM=;
	b=S5trMedZ1bpLgpsICjpH+KIIdPdNQATUg1jG8qEn02FEX+PoZevMJGW18U/iNLKbdY/O
	 zYSuYhAsmPkSjnCzsU39l6qL5vnKzNtee3J0PzvJSt9ADOhAs0KHnlKHePhtvGauCA534
	 79Za29iN12j2cA04rsx0uAqxIgjepz3K4bieCw8VKoaHGSGqiLeN9FCrQ8tTzF27OzYbT
	 GDKtJb1AWPLX6jhPRp7iAPmBOz3I1mKG3n7ViDgcpvMuHfhhAFu33Om8Dv7aWRqj/BxUy
	 EQZelIBsUZfbdkTqWOBUdT8sjX1Mb0sWyI0SWXT/+HG4WhR5qovestjDGr92yVx3reQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=cmss.chinamobile.com;
	spf=pass smtp.mailfrom=cmss.chinamobile.com;
	dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=JkW6qP7a;
	arc=none smtp.remote-ip=111.22.67.137
X-Received: from cmccmta4.chinamobile.com (cmccmta4.chinamobile.com [111.22.67.137])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B0E0606D81B;
	Mon,  9 Nov 2026 08:37:46 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7B0E0606D81B
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmss.chinamobile.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=cmss.chinamobile.com; s=default; l=0;
	h=from:subject:message-id:to:cc:mime-version;
	bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=;
	b=JkW6qP7aelm29RnvG6QDOgxPr7bdP6+bD76LzKrzPjFy8mzZ9HJQVHDdkHMTxUC9+5cRkE6jbqe3/
	 8elLFgsxIDGjqZF6O8HZxaXM43O1ukFKA8uYW54O7uW7DqTvd8iVKdvcU9iene5Rg2LTng1HMeLVeN
	 5xaW0WmygQJ0gy5U=
X-RM-TagInfo: emlType=0                                       
X-RM-SPAM-FLAG: 00000000
X-Received: from spf.mail.chinamobile.com (unknown[10.188.0.87])
	by rmmx-syy-dmz-app04-12004 (RichMail) with SMTP id 2ee46af18635473-6323e;
	Mon, 09 Nov 2026 16:37:09 +0800 (CST)
X-RM-TRANSID: 2ee46af18635473-6323e
X-RM-TagInfo: emlType=0                                       
X-RM-SPAM-FLAG: 00000000
X-Received: from DESKTOP-3K8GUTQ (unknown[223.108.79.98])
	by rmsmtp-syy-appsvr08-12008 (RichMail) with SMTP id 2ee86af18632c1d-886d9;
	Mon, 09 Nov 2026 16:37:09 +0800 (CST)
X-RM-TRANSID: 2ee86af18632c1d-886d9
X-Cc: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	MD Danish Anwar <danishanwar@ti.com>,
	Roger Quadros <rogerq@kernel.org>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	Diogo Ivo <diogo.ivo@siemens.com>,
	Haokexin <haokexin@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.50.1.windows.1
X-In-Reply-To: <179335079339.3327.14537748743173383861@kernel.org>
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