stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "net: cdc_ether: fix divide by 0 on bad descriptors" has been added to the 4.9-stable tree
@ 2017-11-21 12:40 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-11-21 12:40 UTC (permalink / raw)
  To: bjorn, davem, gregkh, oneukum; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    net: cdc_ether: fix divide by 0 on bad descriptors

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-cdc_ether-fix-divide-by-0-on-bad-descriptors.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Tue Nov 21 13:08:13 CET 2017
From: Bj�rn Mork <bjorn@mork.no>
Date: Mon, 6 Nov 2017 15:37:22 +0100
Subject: net: cdc_ether: fix divide by 0 on bad descriptors

From: Bj�rn Mork <bjorn@mork.no>


[ Upstream commit 2cb80187ba065d7decad7c6614e35e07aec8a974 ]

Setting dev->hard_mtu to 0 will cause a divide error in
usbnet_probe. Protect against devices with bogus CDC Ethernet
functional descriptors by ignoring a zero wMaxSegmentSize.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-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/cdc_ether.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -221,7 +221,7 @@ skip:
 			goto bad_desc;
 	}
 
-	if (header.usb_cdc_ether_desc) {
+	if (header.usb_cdc_ether_desc && info->ether->wMaxSegmentSize) {
 		dev->hard_mtu = le16_to_cpu(info->ether->wMaxSegmentSize);
 		/* because of Zaurus, we may be ignoring the host
 		 * side link address we were given.


Patches currently in stable-queue which might be from bjorn@mork.no are

queue-4.9/net-cdc_ether-fix-divide-by-0-on-bad-descriptors.patch
queue-4.9/qmi_wwan-add-missing-skb_reset_mac_header-call.patch
queue-4.9/net-qmi_wwan-fix-divide-by-0-on-bad-descriptors.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-21 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-21 12:40 Patch "net: cdc_ether: fix divide by 0 on bad descriptors" has been added to the 4.9-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).