net: cdc_ether: fix divide by 0 on bad descriptors (CVE-2017-16649)

This commit is contained in:
Ben Hutchings 2017-11-16 18:12:24 +00:00
parent 4ee0c56703
commit 91a7ba9320
3 changed files with 33 additions and 0 deletions

1
debian/changelog vendored
View File

@ -130,6 +130,7 @@ linux (4.13.13-1) UNRELEASED; urgency=medium
* media: imon: Fix null-ptr-deref in imon_probe (CVE-2017-16537)
* media: dib0700: fix invalid dvb_detach argument (CVE-2017-16646)
* net: usb: asix: fill null-ptr-deref in asix_suspend (CVE-2017-16647)
* net: cdc_ether: fix divide by 0 on bad descriptors (CVE-2017-16649)
-- Salvatore Bonaccorso <carnil@debian.org> Sat, 04 Nov 2017 09:54:41 +0100

View File

@ -0,0 +1,31 @@
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
Date: Mon, 6 Nov 2017 15:37:22 +0100
Subject: net: cdc_ether: fix divide by 0 on bad descriptors
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Origin: https://git.kernel.org/linus/2cb80187ba065d7decad7c6614e35e07aec8a974
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-16649
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>
---
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.

View File

@ -122,6 +122,7 @@ bugfix/all/media-cx231xx-cards-fix-null-deref-on-missing-associ.patch
bugfix/all/media-imon-fix-null-ptr-deref-in-imon_probe.patch
bugfix/all/media-dib0700-fix-invalid-dvb_detach-argument.patch
bugfix/all/net-usb-asix-fill-null-ptr-deref-in-asix_suspend.patch
bugfix/all/net-cdc_ether-fix-divide-by-0-on-bad-descriptors.patch
# Fix exported symbol versions
bugfix/alpha/alpha-restore-symbol-versions-for-symbols-exported-f.patch