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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <de7369f7-0526-46f5-b6c3-a98c683c7aa8@lunn.ch>
Date: Sat, 15 Nov 2025 21:53:12 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Pavel Zhigulin <Pavel.Zhigulin@...persky.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
	"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: Re: [PATCH net] net: xilinx: ll_temac: handle
 of_address_to_resource() failure in MDIO setup

On Fri, Nov 14, 2025 at 06:55:18PM +0300, Pavel Zhigulin wrote:
> 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);

I'm not sure this is correct. But it is an odd case. Apart from
setting the name here, res is not used. Imaging a DT blob which does
not have the resource. You get a random name, but the MDIO bus works.
With your change, the probe fails. That is probably a regression.

Are there any .dts files in mainline which do not have the resource?
Then we have a clear regression, and this is then wrong.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ