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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3f7f68d0-6bbd-baa0-5de8-1e8a0a50a04d@gmail.com>
Date:   Fri, 19 Mar 2021 08:40:45 +0100
From:   Heiner Kallweit <hkallweit1@...il.com>
To:     Wong Vee Khee <vee.khee.wong@...el.com>,
        Andrew Lunn <andrew@...n.ch>,
        Russell King <linux@...linux.org.uk>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Jeremy Linton <jeremy.linton@....com>,
        Calvin Johnson <calvin.johnson@....nxp.com>
Cc:     Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Voon Weifeng <weifeng.voon@...el.com>,
        Ong Boon Leong <boon.leong.ong@...el.com>
Subject: Re: [PATCH net V2 1/1] net: phy: fix invalid phy id when probe using
 C22

On 18.03.2021 10:09, Wong Vee Khee wrote:
> When using Clause-22 to probe for PHY devices such as the Marvell
> 88E2110, PHY ID with value 0 is read from the MII PHYID registers
> which caused the PHY framework failed to attach the Marvell PHY
> driver.
> 
> Fixed this by adding a check of PHY ID equals to all zeroes.
> 
> Fixes: ee951005e95e ("net: phy: clean up get_phy_c22_id() invalid ID handling")
> Cc: stable@...r.kernel.org
> Reviewed-by: Voon Weifeng <voon.weifeng@...el.com>
> Signed-off-by: Wong Vee Khee <vee.khee.wong@...el.com>
> ---
> v2 changelog:
>  - added fixes tag
>  - marked for net instead of net-next
> ---
>  drivers/net/phy/phy_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index cc38e326405a..c12c30254c11 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -809,8 +809,8 @@ static int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id)
>  
>  	*phy_id |= phy_reg;
>  
> -	/* If the phy_id is mostly Fs, there is no device there */
> -	if ((*phy_id & 0x1fffffff) == 0x1fffffff)
> +	/* If the phy_id is mostly Fs or all zeroes, there is no device there */
> +	if (((*phy_id & 0x1fffffff) == 0x1fffffff) || (*phy_id == 0))
>  		return -ENODEV;
>  
>  	return 0;
> 

+ the authors of 0cc8fecf041d ("net: phy: Allow mdio buses to auto-probe c45 devices")

In case of MDIOBUS_C22_C45 we probe c22 first, and then c45.
This causes problems with c45 PHY's that have rudimentary c22 support
and return 0 when reading the c22 PHY ID registers.

Is there a specific reason why c22 is probed first? Reversing the order
would solve the issue we speak about here.
c45-probing of c22-only PHY's shouldn't return false positives
(at least at a first glance).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ