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  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:   Wed, 25 Sep 2019 12:01:54 +0000
From:   Radhey Shyam Pandey <radheys@...inx.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>,
        "Alvaro G. M" <alvaro.gamez@...ent.com>
CC:     "David S. Miller" <davem@...emloft.net>,
        Michal Simek <michals@...inx.com>,
        Russell King <linux@...linux.org.uk>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: RE: [PATCH net] net: axienet: fix a signedness bug in probe

> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@...cle.com>
> Sent: Wednesday, September 25, 2019 4:29 PM
> To: Radhey Shyam Pandey <radheys@...inx.com>; Alvaro G. M
> <alvaro.gamez@...ent.com>
> Cc: David S. Miller <davem@...emloft.net>; Michal Simek
> <michals@...inx.com>; Russell King <linux@...linux.org.uk>;
> netdev@...r.kernel.org; kernel-janitors@...r.kernel.org
> Subject: [PATCH net] net: axienet: fix a signedness bug in probe
> 
> The "lp->phy_mode" is an enum but in this context GCC treats it as an
> unsigned int so the error handling is never triggered.
> 
> Fixes: ee06b1728b95 ("net: axienet: add support for standard phy-mode
> binding")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@...inx.com>

> ---
>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 4fc627fb4d11..676006f32f91 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -1762,7 +1762,7 @@ static int axienet_probe(struct platform_device
> *pdev)
>  		}
>  	} else {
>  		lp->phy_mode = of_get_phy_mode(pdev->dev.of_node);
> -		if (lp->phy_mode < 0) {
> +		if ((int)lp->phy_mode < 0) {
>  			ret = -EINVAL;
>  			goto free_netdev;
>  		}
> --
> 2.20.1

Powered by blists - more mailing lists