public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Oliver Neukum <oneukum@suse.com>
Cc: syzkaller-bugs@googlegroups.com, netdev@vger.kernel.org,
	linux-usb@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	syzbot+76bb1d34ffa0adc03baa@syzkaller.appspotmail.com
Subject: Re: [PATCHv2] usbnet: sanity check for maxpacket
Date: Thu, 21 Oct 2021 14:38:08 +0200	[thread overview]
Message-ID: <YXFfMCZA3XHzHfgQ@hovoldconsulting.com> (raw)
In-Reply-To: <20211021122944.21816-1-oneukum@suse.com>

On Thu, Oct 21, 2021 at 02:29:44PM +0200, Oliver Neukum wrote:
> maxpacket of 0 makes no sense and oopses as we need to divide
> by it. Give up.
> 
> V2: fixed typo in log and stylistic issues

Changelog goes below the ---

> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> Reported-by: syzbot+76bb1d34ffa0adc03baa@syzkaller.appspotmail.com

Again,

Reviewed-by: Johan Hovold <johan@kernel.org>

> ---
>  drivers/net/usb/usbnet.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 840c1c2ab16a..80432ee0ce69 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -1788,6 +1788,10 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
>  	if (!dev->rx_urb_size)
>  		dev->rx_urb_size = dev->hard_mtu;
>  	dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
> +	if (dev->maxpacket == 0) {
> +		/* that is a broken device */
> +		goto out4;
> +	}
>  
>  	/* let userspace know we have a random address */
>  	if (ether_addr_equal(net->dev_addr, node_id))

  reply	other threads:[~2021-10-21 12:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 12:29 [PATCHv2] usbnet: sanity check for maxpacket Oliver Neukum
2021-10-21 12:38 ` Johan Hovold [this message]
2021-10-21 15:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YXFfMCZA3XHzHfgQ@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=syzbot+76bb1d34ffa0adc03baa@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox