* Patch "USB: hub: fix SS hub-descriptor handling" has been added to the 4.9-stable tree
@ 2017-05-23 12:43 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-05-23 12:43 UTC (permalink / raw)
To: johan, John.Youn, gregkh, stern; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
USB: hub: fix SS hub-descriptor handling
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:
usb-hub-fix-ss-hub-descriptor-handling.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 2c25a2c818023df64463aac3288a9f969491e507 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@kernel.org>
Date: Wed, 10 May 2017 18:18:27 +0200
Subject: USB: hub: fix SS hub-descriptor handling
From: Johan Hovold <johan@kernel.org>
commit 2c25a2c818023df64463aac3288a9f969491e507 upstream.
A SuperSpeed hub descriptor does not have any variable-length fields so
bail out when reading a short descriptor.
This avoids parsing and leaking two bytes of uninitialised slab data
through sysfs removable-attributes.
Fixes: dbe79bbe9dcb ("USB 3.0 Hub Changes")
Cc: John Youn <John.Youn@synopsys.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/core/hub.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -378,8 +378,12 @@ static int get_hub_descriptor(struct usb
USB_REQ_GET_DESCRIPTOR, USB_DIR_IN | USB_RT_HUB,
dtype << 8, 0, data, size,
USB_CTRL_GET_TIMEOUT);
- if (ret >= (USB_DT_HUB_NONVAR_SIZE + 2))
+ if (hub_is_superspeed(hdev)) {
+ if (ret == size)
+ return ret;
+ } else if (ret >= (USB_DT_HUB_NONVAR_SIZE + 2)) {
return ret;
+ }
}
return -EINVAL;
}
@@ -1319,7 +1323,7 @@ static int hub_configure(struct usb_hub
/* Request the entire hub descriptor.
* hub->descriptor can handle USB_MAXCHILDREN ports,
- * but the hub can/will return fewer bytes here.
+ * but a (non-SS) hub can/will return fewer bytes here.
*/
ret = get_hub_descriptor(hdev, hub->descriptor);
if (ret < 0) {
Patches currently in stable-queue which might be from johan@kernel.org are
queue-4.9/usb-serial-io_ti-fix-div-by-zero-in-set_termios.patch
queue-4.9/usb-chaoskey-fix-alea-quirk-on-big-endian-hosts.patch
queue-4.9/usb-hub-fix-non-ss-hub-descriptor-handling.patch
queue-4.9/usb-serial-ftdi_sio-add-olimex-arm-usb-tiny-h-pids.patch
queue-4.9/usb-serial-ftdi_sio-fix-setting-latency-for-unprivileged-users.patch
queue-4.9/usb-iowarrior-fix-info-ioctl-on-big-endian-hosts.patch
queue-4.9/watchdog-pcwd_usb-fix-null-deref-at-probe.patch
queue-4.9/usb-serial-qcserial-add-more-lenovo-em74xx-device-ids.patch
queue-4.9/usb-serial-option-add-telit-me910-support.patch
queue-4.9/net-irda-irda-usb-fix-firmware-name-on-big-endian-hosts.patch
queue-4.9/of-fdt-add-missing-allocation-failure-check.patch
queue-4.9/usbvision-fix-null-deref-at-probe.patch
queue-4.9/usb-serial-mct_u232-fix-big-endian-baud-rate-handling.patch
queue-4.9/usb-ehci-platform-fix-companion-device-leak.patch
queue-4.9/mceusb-fix-null-deref-at-probe.patch
queue-4.9/usb-hub-fix-ss-hub-descriptor-handling.patch
queue-4.9/ath9k_htc-fix-null-deref-at-probe.patch
queue-4.9/usb-musb-fix-trying-to-suspend-while-active-for-otg-configurations.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-05-23 12:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-23 12:43 Patch "USB: hub: fix SS hub-descriptor handling" 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).