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]
Date:   Mon, 27 Apr 2020 11:10:39 +0200
From:   Heiner Kallweit <hkallweit1@...il.com>
To:     Anthony Felice <tony.felice@...esys.com>
Cc:     Akshay Bhat <akshay.bhat@...esys.com>,
        "David S. Miller" <davem@...emloft.net>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        Nathan Chancellor <natechancellor@...il.com>,
        Rob Herring <robh@...nel.org>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Andrew Lunn <andrew@...n.ch>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: tc35815: Fix phydev supported/advertising mask

On 27.04.2020 04:00, Anthony Felice wrote:
> Commit 3c1bcc8614db ("net: ethernet: Convert phydev advertize and
> supported from u32 to link mode") updated ethernet drivers to use a
> linkmode bitmap. It mistakenly dropped a bitwise negation in the
> tc35815 ethernet driver on a bitmask to set the supported/advertising
> flags.
> 
> Found by Anthony via code inspection, not tested as I do not have the
> required hardware.
> 
> Fixes: 3c1bcc8614db ("net: ethernet: Convert phydev advertize and supported from u32 to link mode")
> Signed-off-by: Anthony Felice <tony.felice@...esys.com>
> Reviewed-by: Akshay Bhat <akshay.bhat@...esys.com>
> ---
>  drivers/net/ethernet/toshiba/tc35815.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/toshiba/tc35815.c b/drivers/net/ethernet/toshiba/tc35815.c
> index 3fd43d30b20d..a1066fbb93b5 100644
> --- a/drivers/net/ethernet/toshiba/tc35815.c
> +++ b/drivers/net/ethernet/toshiba/tc35815.c
> @@ -643,7 +643,7 @@ static int tc_mii_probe(struct net_device *dev)
>  		linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, mask);
>  		linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, mask);
>  	}
> -	linkmode_and(phydev->supported, phydev->supported, mask);
> +	linkmode_andnot(phydev->supported, phydev->supported, mask);
>  	linkmode_copy(phydev->advertising, phydev->supported);
>  
>  	lp->link = 0;
> 
> base-commit: 55b2af1c23eb12663015998079992f79fdfa56c8
> 
Reviewed-by: Heiner Kallweit <hkallweit1@...il.com>

The complete structure of this code is quite weird (e.g. using module
parameters to force a link mode), but the driver seems to be too old
that anybody would spend effort on refactoring it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ