diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-12-15 16:03:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-12-15 16:03:25 -0500 |
commit | c36c7a7c4034f2ef35c6aa6821e7c82d9968dba4 (patch) | |
tree | 73bce2bfabbd7ec2fbc0d466469ea32e4b2a5490 /drivers/usb/core/config.c | |
parent | a84ec72324e291262137726d10d67f90c4c5110e (diff) | |
parent | 48a4ff1c7bb5a32d2e396b03132d20d552c0eca7 (diff) |
Merge tag 'usb-4.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH:
"Here are some USB fixes for 4.15-rc4.
There is the usual handful gadget/dwc2/dwc3 fixes as always, for
reported issues. But the most important things in here is the core fix
from Alan Stern to resolve a nasty security bug (my first attempt is
reverted, Alan's was much cleaner), as well as a number of usbip fixes
from Shuah Khan to resolve those reported security issues.
All of these have been in linux-next with no reported issues"
* tag 'usb-4.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
USB: core: prevent malicious bNumInterfaces overflow
Revert "USB: core: only clean up what we allocated"
USB: core: only clean up what we allocated
Revert "usb: gadget: allow to enable legacy drivers without USB_ETH"
usb: gadget: webcam: fix V4L2 Kconfig dependency
usb: dwc2: Fix TxFIFOn sizes and total TxFIFO size issues
usb: dwc3: gadget: Fix PCM1 for ISOC EP with ep->mult less than 3
usb: dwc3: of-simple: set dev_pm_ops
usb: dwc3: of-simple: fix missing clk_disable_unprepare
usb: dwc3: gadget: Wait longer for controller to end command processing
usb: xhci: fix TDS for MTK xHCI1.1
xhci: Don't add a virt_dev to the devs array before it's fully allocated
usbip: fix stub_send_ret_submit() vulnerability to null transfer_buffer
usbip: prevent vhci_hcd driver from leaking a socket pointer address
usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input
usbip: fix stub_rx: get_pipe() to validate endpoint number
tools/usbip: fixes potential (minor) "buffer overflow" (detected on recent gcc with -Werror)
USB: uas and storage: Add US_FL_BROKEN_FUA for another JMicron JMS567 ID
usb: musb: da8xx: fix babble condition handling
Diffstat (limited to 'drivers/usb/core/config.c')
-rw-r--r-- | drivers/usb/core/config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 55b198ba629b..78e92d29f8d9 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c | |||
@@ -555,6 +555,9 @@ static int usb_parse_configuration(struct usb_device *dev, int cfgidx, | |||
555 | unsigned iad_num = 0; | 555 | unsigned iad_num = 0; |
556 | 556 | ||
557 | memcpy(&config->desc, buffer, USB_DT_CONFIG_SIZE); | 557 | memcpy(&config->desc, buffer, USB_DT_CONFIG_SIZE); |
558 | nintf = nintf_orig = config->desc.bNumInterfaces; | ||
559 | config->desc.bNumInterfaces = 0; // Adjusted later | ||
560 | |||
558 | if (config->desc.bDescriptorType != USB_DT_CONFIG || | 561 | if (config->desc.bDescriptorType != USB_DT_CONFIG || |
559 | config->desc.bLength < USB_DT_CONFIG_SIZE || | 562 | config->desc.bLength < USB_DT_CONFIG_SIZE || |
560 | config->desc.bLength > size) { | 563 | config->desc.bLength > size) { |
@@ -568,7 +571,6 @@ static int usb_parse_configuration(struct usb_device *dev, int cfgidx, | |||
568 | buffer += config->desc.bLength; | 571 | buffer += config->desc.bLength; |
569 | size -= config->desc.bLength; | 572 | size -= config->desc.bLength; |
570 | 573 | ||
571 | nintf = nintf_orig = config->desc.bNumInterfaces; | ||
572 | if (nintf > USB_MAXINTERFACES) { | 574 | if (nintf > USB_MAXINTERFACES) { |
573 | dev_warn(ddev, "config %d has too many interfaces: %d, " | 575 | dev_warn(ddev, "config %d has too many interfaces: %d, " |
574 | "using maximum allowed: %d\n", | 576 | "using maximum allowed: %d\n", |