lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251114155519.3524628-1-Pavel.Zhigulin@kaspersky.com>
Date: Fri, 14 Nov 2025 18:55:18 +0300
From: Pavel Zhigulin <Pavel.Zhigulin@...persky.com>
To: Andrew Lunn <andrew+netdev@...n.ch>
CC: Pavel Zhigulin <Pavel.Zhigulin@...persky.com>, "David S. Miller"
	<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
	<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Michal Simek
	<michal.simek@....com>, Esben Haabendal <esben@...nix.com>,
	<netdev@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <lvc-project@...uxtesting.org>
Subject: [PATCH net] net: xilinx: ll_temac: handle of_address_to_resource() failure in MDIO setup

temac_mdio_setup() ignores potential errors from
of_address_to_resource() call and continues with
an uninitialized resource.

Add return value check for of_address_to_resource()
call in temac_mdio_setup().

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 8425c41d1ef7 ("net: ll_temac: Extend support to non-device-tree platforms")
Signed-off-by: Pavel Zhigulin <Pavel.Zhigulin@...persky.com>
---
 drivers/net/ethernet/xilinx/ll_temac_mdio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/xilinx/ll_temac_mdio.c b/drivers/net/ethernet/xilinx/ll_temac_mdio.c
index 07a9fb49eda1..ab23dc233768 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_mdio.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_mdio.c
@@ -98,7 +98,9 @@ int temac_mdio_setup(struct temac_local *lp, struct platform_device *pdev)
 		return -ENOMEM;

 	if (np) {
-		of_address_to_resource(np, 0, &res);
+		rc = of_address_to_resource(np, 0, &res);
+		if (rc)
+			return rc;
 		snprintf(bus->id, MII_BUS_ID_SIZE, "%.8llx",
 			 (unsigned long long)res.start);
 	} else if (pdata) {
--
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ