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] [thread-next>] [day] [month] [year] [list]
Message-ID: <b49e6c21-8e0a-4e54-86eb-c18f1446c430@lunn.ch>
Date: Tue, 15 Apr 2025 03:35:07 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Qasim Ijaz <qasdev00@...il.com>
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
	kuba@...nel.org, pabeni@...hat.com, horms@...nel.org,
	linux-usb@...r.kernel.org, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	syzbot+3361c2d6f78a3e0892f9@...kaller.appspotmail.com,
	stable@...r.kernel.org
Subject: Re: [PATCH 5/5] net: ch9200: avoid triggering NWay restart on
 non-zero PHY ID

On Sat, Apr 12, 2025 at 07:38:29PM +0100, Qasim Ijaz wrote:
> During ch9200_mdio_read if the phy_id is not 0 -ENODEV is returned.
> 
> In certain cases such as in mii_nway_restart returning a negative such
> as -ENODEV triggers the "bmcr & BMCR_ANENABLE" check, we should avoid 
> this on error and just end the function.
> 
> To address this just return 0.
> 
> Signed-off-by: Qasim Ijaz <qasdev00@...il.com> 
> ---
>  drivers/net/usb/ch9200.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/usb/ch9200.c b/drivers/net/usb/ch9200.c
> index 187bbfc991f5..281800bb2ff2 100644
> --- a/drivers/net/usb/ch9200.c
> +++ b/drivers/net/usb/ch9200.c
> @@ -182,7 +182,7 @@ static int ch9200_mdio_read(struct net_device *netdev, int phy_id, int loc)
>  		   __func__, phy_id, loc);
>  
>  	if (phy_id != 0)
> -		return -ENODEV;
> +		return 0;

An actually MDIO bus would return 0xffff is asked to read from a PHY
which is not on the bus. But i've no idea how the ancient mii code
handles this.

If this code every gets updated to using phylib, many of the changes
you are making will need reverting because phylib actually wants to
see the errors. So i'm somewhat reluctant to make changes like this.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ