1. 27 Oct, 2017 9 commits
    • Jonathan Liu's avatar
      usb: musb: sunxi: Explicitly release USB PHY on exit · 583a4219
      Jonathan Liu authored
      commit 6ed05c68 upstream.
      
      This fixes a kernel oops when unloading the driver due to usb_put_phy
      being called after usb_phy_generic_unregister when the device is
      detached. Calling usb_phy_generic_unregister causes x->dev->driver to
      be NULL in usb_put_phy and results in a NULL pointer dereference.
      Signed-off-by: default avatarJonathan Liu <net147@gmail.com>
      Signed-off-by: default avatarBin Liu <b-liu@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      583a4219
    • Wolfgang Grandegger's avatar
      can: gs_usb: fix busy loop if no more TX context is available · d68b07a1
      Wolfgang Grandegger authored
      commit 97819f94 upstream.
      
      If sending messages with no cable connected, it quickly happens that
      there is no more TX context available. Then "gs_can_start_xmit()"
      returns with "NETDEV_TX_BUSY" and the upper layer does retry
      immediately keeping the CPU busy. To fix that issue, I moved
      "atomic_dec(&dev->active_tx_urbs)" from "gs_usb_xmit_callback()" to
      the TX done handling in "gs_usb_receive_bulk_callback()". Renaming
      "active_tx_urbs" to "active_tx_contexts" and moving it into
      "gs_[alloc|free]_tx_context()" would also make sense.
      Signed-off-by: default avatarWolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d68b07a1
    • Jussi Laako's avatar
      ALSA: usb-audio: Add native DSD support for Pro-Ject Pre Box S2 Digital · f7d8b2e1
      Jussi Laako authored
      commit 9bb201a5 upstream.
      
      Add native DSD support quirk for Pro-Ject Pre Box S2 Digital USB id
      2772:0230.
      Signed-off-by: default avatarJussi Laako <jussi@sonarnerd.net>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f7d8b2e1
    • Mathias Nyman's avatar
      usb: hub: Allow reset retry for USB2 devices on connect bounce · 67e25805
      Mathias Nyman authored
      commit 1ac7db63 upstream.
      
      If the connect status change is set during reset signaling, but
      the status remains connected just retry port reset.
      
      This solves an issue with connecting a 90W HP Thunderbolt 3 dock
      with a Lenovo Carbon x1 (5th generation) which causes a 30min loop
      of a high speed device being re-discovererd before usb ports starts
      working.
      
      [...]
      [ 389.023845] usb 3-1: new high-speed USB device number 55 using xhci_hcd
      [ 389.491841] usb 3-1: new high-speed USB device number 56 using xhci_hcd
      [ 389.959928] usb 3-1: new high-speed USB device number 57 using xhci_hcd
      [...]
      
      This is caused by a high speed device that doesn't successfully go to the
      enabled state after the second port reset. Instead the connection bounces
      (connected, with connect status change), bailing out completely from
      enumeration just to restart from scratch.
      
      Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1716332Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      67e25805
    • Felipe Balbi's avatar
      usb: quirks: add quirk for WORLDE MINI MIDI keyboard · d012ab21
      Felipe Balbi authored
      commit 2811501e upstream.
      
      This keyboard doesn't implement Get String descriptors properly even
      though string indexes are valid. What happens is that when requesting
      for the String descriptor, the device disconnects and
      reconnects. Without this quirk, this loop will continue forever.
      
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarВладимир Мартьянов <vilgeforce@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d012ab21
    • Maksim Salau's avatar
      usb: cdc_acm: Add quirk for Elatec TWN3 · d729f29a
      Maksim Salau authored
      commit 765fb2f1 upstream.
      
      Elatec TWN3 has the union descriptor on data interface. This results in
      failure to bind the device to the driver with the following log:
        usb 1-1.2: new full speed USB device using streamplug-ehci and address 4
        usb 1-1.2: New USB device found, idVendor=09d8, idProduct=0320
        usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
        usb 1-1.2: Product: RFID Device (COM)
        usb 1-1.2: Manufacturer: OEM
        cdc_acm 1-1.2:1.0: Zero length descriptor references
        cdc_acm: probe of 1-1.2:1.0 failed with error -22
      
      Adding the NO_UNION_NORMAL quirk for the device fixes the issue.
      
      `lsusb -v` of the device:
      
      Bus 001 Device 003: ID 09d8:0320
      Device Descriptor:
        bLength                18
        bDescriptorType         1
        bcdUSB               2.00
        bDeviceClass            2 Communications
        bDeviceSubClass         0
        bDeviceProtocol         0
        bMaxPacketSize0        32
        idVendor           0x09d8
        idProduct          0x0320
        bcdDevice            3.00
        iManufacturer           1 OEM
        iProduct                2 RFID Device (COM)
        iSerial                 0
        bNumConfigurations      1
        Configuration Descriptor:
          bLength                 9
          bDescriptorType         2
          wTotalLength           67
          bNumInterfaces          2
          bConfigurationValue     1
          iConfiguration          0
          bmAttributes         0x80
            (Bus Powered)
          MaxPower              250mA
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        0
            bAlternateSetting       0
            bNumEndpoints           1
            bInterfaceClass         2 Communications
            bInterfaceSubClass      2 Abstract (modem)
            bInterfaceProtocol      1 AT-commands (v.25ter)
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x83  EP 3 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0020  1x 32 bytes
              bInterval               2
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0 Unused
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x02  EP 2 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0020  1x 32 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x81  EP 1 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0020  1x 32 bytes
              bInterval               0
            CDC Header:
              bcdCDC               1.10
            CDC Call Management:
              bmCapabilities       0x03
                call management
                use DataInterface
              bDataInterface          1
            CDC ACM:
              bmCapabilities       0x06
                sends break
                line coding and serial state
            CDC Union:
              bMasterInterface        0
              bSlaveInterface         1
      Device Status:     0x0000
        (Bus Powered)
      Signed-off-by: default avatarMaksim Salau <msalau@iotecha.com>
      Acked-by: default avatarOliver Neukum <oneukum@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d729f29a
    • Johan Hovold's avatar
      USB: serial: metro-usb: add MS7820 device id · 4512d650
      Johan Hovold authored
      commit 31dc3f81 upstream.
      
      Add device-id entry for (Honeywell) Metrologic MS7820 bar code scanner.
      
      The device has two interfaces (in this mode?); a vendor-specific
      interface with two interrupt endpoints and a second HID interface, which
      we do not bind to.
      Reported-by: default avatarLadislav Dobrovsky <ladislav.dobrovsky@gmail.com>
      Tested-by: default avatarLadislav Dobrovsky <ladislav.dobrovsky@gmail.com>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4512d650
    • Alan Stern's avatar
      USB: core: fix out-of-bounds access bug in usb_get_bos_descriptor() · 9dff499d
      Alan Stern authored
      commit 1c0edc36 upstream.
      
      Andrey used the syzkaller fuzzer to find an out-of-bounds memory
      access in usb_get_bos_descriptor().  The code wasn't checking that the
      next usb_dev_cap_header structure could fit into the remaining buffer
      space.
      
      This patch fixes the error and also reduces the bNumDeviceCaps field
      in the header to match the actual number of capabilities found, in
      cases where there are fewer than expected.
      Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Tested-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9dff499d
    • Hans de Goede's avatar
      USB: devio: Revert "USB: devio: Don't corrupt user memory" · abe43c97
      Hans de Goede authored
      commit 845d584f upstream.
      
      Taking the uurb->buffer_length userspace passes in as a maximum for the
      actual urbs transfer_buffer_length causes 2 serious issues:
      
      1) It breaks isochronous support for all userspace apps using libusb,
         as existing libusb versions pass in 0 for uurb->buffer_length,
         relying on the kernel using the lenghts of the usbdevfs_iso_packet_desc
         descriptors passed in added together as buffer length.
      
         This for example causes redirection of USB audio and Webcam's into
         virtual machines using qemu-kvm to no longer work. This is a userspace
         ABI break and as such must be reverted.
      
         Note that the original commit does not protect other users / the
         kernels memory, it only stops the userspace process making the call
         from shooting itself in the foot.
      
      2) It may cause the kernel to program host controllers to DMA over random
         memory. Just as the devio code used to only look at the iso_packet_desc
         lenghts, the host drivers do the same, relying on the submitter of the
         urbs to make sure the entire buffer is large enough and not checking
         transfer_buffer_length.
      
         But the "USB: devio: Don't corrupt user memory" commit now takes the
         userspace provided uurb->buffer_length for the buffer-size while copying
         over the user-provided iso_packet_desc lengths 1:1, allowing the user
         to specify a small buffer size while programming the host controller to
         dma a lot more data.
      
         (Atleast the ohci, uhci, xhci and fhci drivers do not check
          transfer_buffer_length for isoc transfers.)
      
      This reverts commit fa1ed74e ("USB: devio: Don't corrupt user memory")
      fixing both these issues.
      
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      abe43c97
  2. 21 Oct, 2017 31 commits