From: Greg Kroah-Hartman Date: Mon, 26 Jun 2017 12:25:20 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v3.18.59~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d1ca9a0b4a8eec8055e8c3cf350d07e7236f6e0;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: usb-usbip-fix-nonconforming-hub-descriptor.patch --- diff --git a/queue-4.4/series b/queue-4.4/series index 58928aa487c..0434c6e8237 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -14,3 +14,4 @@ drm-radeon-add-a-px-quirk-for-another-k53tk-variant.patch drm-radeon-add-a-quirk-for-toshiba-satellite-l20-183.patch drm-amdgpu-atom-fix-ps-allocation-size-for-enabledisppowergating.patch drm-amdgpu-adjust-default-display-clock.patch +usb-usbip-fix-nonconforming-hub-descriptor.patch diff --git a/queue-4.4/usb-usbip-fix-nonconforming-hub-descriptor.patch b/queue-4.4/usb-usbip-fix-nonconforming-hub-descriptor.patch new file mode 100644 index 00000000000..8532112fbef --- /dev/null +++ b/queue-4.4/usb-usbip-fix-nonconforming-hub-descriptor.patch @@ -0,0 +1,58 @@ +From ec963b412a54aac8e527708ecad06a6988a86fb4 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Wed, 10 May 2017 18:18:26 +0200 +Subject: USB: usbip: fix nonconforming hub descriptor + +From: Johan Hovold + +commit ec963b412a54aac8e527708ecad06a6988a86fb4 upstream. + +Fix up the root-hub descriptor to accommodate the variable-length +DeviceRemovable and PortPwrCtrlMask fields, while marking all ports as +removable (and leaving the reserved bit zero unset). + +Also add a build-time constraint on VHCI_HC_PORTS which must never be +greater than USB_MAXCHILDREN (but this was only enforced through a +KConfig constant). + +This specifically fixes the descriptor layout whenever VHCI_HC_PORTS is +greater than seven (default is 8). + +Fixes: 04679b3489e0 ("Staging: USB/IP: add client driver") +Cc: Takahiro Hirofuchi +Cc: Valentina Manea +Signed-off-by: Johan Hovold +Acked-by: Shuah Khan +[ johan: backport to v4.4, which uses VHCI_NPORTS ] +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/usbip/vhci_hcd.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +--- a/drivers/usb/usbip/vhci_hcd.c ++++ b/drivers/usb/usbip/vhci_hcd.c +@@ -215,14 +215,19 @@ done: + + static inline void hub_descriptor(struct usb_hub_descriptor *desc) + { ++ int width; ++ + memset(desc, 0, sizeof(*desc)); + desc->bDescriptorType = USB_DT_HUB; +- desc->bDescLength = 9; + desc->wHubCharacteristics = cpu_to_le16( + HUB_CHAR_INDV_PORT_LPSM | HUB_CHAR_COMMON_OCPM); ++ + desc->bNbrPorts = VHCI_NPORTS; +- desc->u.hs.DeviceRemovable[0] = 0xff; +- desc->u.hs.DeviceRemovable[1] = 0xff; ++ BUILD_BUG_ON(VHCI_NPORTS > USB_MAXCHILDREN); ++ width = desc->bNbrPorts / 8 + 1; ++ desc->bDescLength = USB_DT_HUB_NONVAR_SIZE + 2 * width; ++ memset(&desc->u.hs.DeviceRemovable[0], 0, width); ++ memset(&desc->u.hs.DeviceRemovable[width], 0xff, width); + } + + static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,