usbnet: sanity checking of packet sizes and device mtu
authorOliver Neukum <oneukum@suse.com>
Thu, 19 Sep 2019 08:23:08 +0000 (10:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 10:47:42 +0000 (12:47 +0200)
commitff7bcdb6a1dbddfdde1beaef27ea6f2ed81ff2c2
tree8f16ee1625e2e1a52cadcbb1d7545f1fb735e5e0
parent6c95f6a3c9c313d46fbf7f466671e2523b0b171c
usbnet: sanity checking of packet sizes and device mtu

[ Upstream commit 280ceaed79f18db930c0cc8bb21f6493490bf29c ]

After a reset packet sizes and device mtu can change and need
to be reevaluated to calculate queue sizes.
Malicious devices can set this to zero and we divide by it.
Introduce sanity checking.

Reported-and-tested-by: syzbot+6102c120be558c885f04@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/usb/usbnet.c