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: <20210819123429.7b15f08e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Thu, 19 Aug 2021 12:34:29 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Petko Manolov <petko.manolov@...sulko.com>
Cc:     davem@...emloft.net, netdev@...r.kernel.org, paskripkin@...il.com,
        stable@...r.kernel.org
Subject: Re: [PATCH] net: usb: pegasus: fixes of set_register(s) return
 value evaluation;

On Thu, 19 Aug 2021 12:05:39 +0300 Petko Manolov wrote:
>   - restore the behavior in enable_net_traffic() to avoid regressions - Jakub
>     Kicinski;
>   - hurried up and removed redundant assignment in pegasus_open() before yet
>     another checker complains;
>   - explicitly check for negative value in pegasus_set_wol(), even if
>     usb_control_msg_send() never return positive number we'd still be in sync
>     with the rest of the driver style;
> 
> Fixes: 8a160e2e9aeb net: usb: pegasus: Check the return value of get_geristers() and friends;

I guess this is fine but not exactly the preferred format, please see
Submitting patches.

> Reported-by: Jakub Kicinski <kuba@...nel.org>
> Signed-off-by: Petko Manolov <petko.manolov@...sulko.com>
> ---
>  drivers/net/usb/pegasus.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
> index 652e9fcf0b77..1ef93082c772 100644
> --- a/drivers/net/usb/pegasus.c
> +++ b/drivers/net/usb/pegasus.c
> @@ -446,7 +446,7 @@ static int enable_net_traffic(struct net_device *dev, struct usb_device *usb)
>  		write_mii_word(pegasus, 0, 0x1b, &auxmode);
>  	}
>  
> -	return 0;
> +	return ret;

yup

>  fail:
>  	netif_dbg(pegasus, drv, pegasus->net, "%s failed\n", __func__);
>  	return ret;
> @@ -835,7 +835,7 @@ static int pegasus_open(struct net_device *net)
>  	if (!pegasus->rx_skb)
>  		goto exit;
>  
> -	res = set_registers(pegasus, EthID, 6, net->dev_addr);
> +	set_registers(pegasus, EthID, 6, net->dev_addr);

yup

>  	usb_fill_bulk_urb(pegasus->rx_urb, pegasus->usb,
>  			  usb_rcvbulkpipe(pegasus->usb, 1),
> @@ -932,7 +932,7 @@ pegasus_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
>  	pegasus->wolopts = wol->wolopts;
>  
>  	ret = set_register(pegasus, WakeupControl, reg78);
> -	if (!ret)
> +	if (ret < 0)
>  		ret = device_set_wakeup_enable(&pegasus->usb->dev,
>  						wol->wolopts);

now this looks incorrect and unrelated to recent changes (IOW the
commit under Fixes), please drop this chunk

>  	return ret;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ