1. 01 12月, 2018 7 次提交
  2. 27 11月, 2018 5 次提交
  3. 14 11月, 2018 10 次提交
  4. 18 10月, 2018 1 次提交
  5. 16 10月, 2018 1 次提交
    • A
      USB: fix the usbfs flag sanitization for control transfers · 665c365a
      Alan Stern 提交于
      Commit 7a68d9fb ("USB: usbdevfs: sanitize flags more") checks the
      transfer flags for URBs submitted from userspace via usbfs.  However,
      the check for whether the USBDEVFS_URB_SHORT_NOT_OK flag should be
      allowed for a control transfer was added in the wrong place, before
      the code has properly determined the direction of the control
      transfer.  (Control transfers are special because for them, the
      direction is set by the bRequestType byte of the Setup packet rather
      than direction bit of the endpoint address.)
      
      This patch moves code which sets up the allow_short flag for control
      transfers down after is_in has been set to the correct value.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: syzbot+24a30223a4b609bb802e@syzkaller.appspotmail.com
      Fixes: 7a68d9fb ("USB: usbdevfs: sanitize flags more")
      CC: Oliver Neukum <oneukum@suse.com>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      665c365a
  6. 09 10月, 2018 6 次提交
  7. 02 10月, 2018 3 次提交
  8. 24 9月, 2018 1 次提交
    • J
      USB: serial: simple: add Motorola Tetra MTP6550 id · f5fad711
      Johan Hovold 提交于
      Add device-id for the Motorola Tetra radio MTP6550.
      
      Bus 001 Device 004: ID 0cad:9012 Motorola CGISS
      Device Descriptor:
        bLength                18
        bDescriptorType         1
        bcdUSB               2.00
        bDeviceClass            0 (Defined at Interface level)
        bDeviceSubClass         0
        bDeviceProtocol         0
        bMaxPacketSize0        64
        idVendor           0x0cad Motorola CGISS
        idProduct          0x9012
        bcdDevice           24.16
        iManufacturer           1 Motorola Solutions, Inc.
        iProduct                2 TETRA PEI interface
        iSerial                 0
        bNumConfigurations      1
        Configuration Descriptor:
          bLength                 9
          bDescriptorType         2
          wTotalLength           55
          bNumInterfaces          2
          bConfigurationValue     1
          iConfiguration          3 Generic Serial config
          bmAttributes         0x80
            (Bus Powered)
          MaxPower              500mA
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        0
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass      0
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x81  EP 1 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x01  EP 1 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass      0
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x82  EP 2 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x02  EP 2 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
      Device Qualifier (for other device speed):
        bLength                10
        bDescriptorType         6
        bcdUSB               2.00
        bDeviceClass            0 (Defined at Interface level)
        bDeviceSubClass         0
        bDeviceProtocol         0
        bMaxPacketSize0        64
        bNumConfigurations      1
      Device Status:     0x0000
        (Bus Powered)
      Reported-by: NHans Hult <hanshult35@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      f5fad711
  9. 20 9月, 2018 6 次提交
    • H
      usb: typec: mux: Take care of driver module reference counting · 3e3b8196
      Heikki Krogerus 提交于
      Functions typec_mux_get() and typec_switch_get() already
      make sure that the mux device reference count is
      incremented, but the same must be done to the driver module
      as well to prevent the drivers from being unloaded in the
      middle of operation.
      
      This fixes a potential "BUG: unable to handle kernel paging
      request at ..." from happening.
      
      Fixes: 93dd2112 ("usb: typec: mux: Get the mux identifier from function parameter")
      Acked-by: NHans de Goede <hdegoede@redhat.com>
      Tested-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3e3b8196
    • H
      usb: core: safely deal with the dynamic quirk lists · 16c4cb19
      Harry Pan 提交于
      Applying dynamic usbcore quirks in early booting when the slab is
      not yet ready would cause kernel panic of null pointer dereference
      because the quirk_count has been counted as 1 while the quirk_list
      was failed to allocate.
      
      i.e.,
      [    1.044970] BUG: unable to handle kernel NULL pointer dereference at           (null)
      [    1.044995] IP: [<ffffffffb0953ec7>] usb_detect_quirks+0x88/0xd1
      [    1.045016] PGD 0
      [    1.045026] Oops: 0000 [#1] PREEMPT SMP
      [    1.046986] gsmi: Log Shutdown Reason 0x03
      [    1.046995] Modules linked in:
      [    1.047008] CPU: 0 PID: 81 Comm: kworker/0:3 Not tainted 4.4.154 #28
      [    1.047016] Hardware name: Google Coral/Coral, BIOS Google_Coral.10068.27.0 12/04/2017
      [    1.047028] Workqueue: usb_hub_wq hub_event
      [    1.047037] task: ffff88017a321c80 task.stack: ffff88017a384000
      [    1.047044] RIP: 0010:[<ffffffffb0953ec7>]  [<ffffffffb0953ec7>] usb_detect_quirks+0x88/0xd1
      
      To tackle this odd, let's balance the quirk_count to 0 when the kcalloc
      call fails, and defer the quirk setting into a lower level callback
      which ensures that the kernel memory management has been initialized.
      
      Fixes: 027bd6ca ("usb: core: Add "quirks" parameter for usbcore")
      Signed-off-by: NHarry Pan <harry.pan@intel.com>
      Acked-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      16c4cb19
    • H
      usb: roles: Take care of driver module reference counting · 5c54fcac
      Heikki Krogerus 提交于
      This fixes potential "BUG: unable to handle kernel paging
      request at ..." from happening.
      
      Fixes: fde0aa6c ("usb: common: Small class for USB role switches")
      Cc: <stable@vger.kernel.org>
      Acked-by: NHans de Goede <hdegoede@redhat.com>
      Tested-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5c54fcac
    • A
      USB: handle NULL config in usb_find_alt_setting() · c9a4cb20
      Alan Stern 提交于
      usb_find_alt_setting() takes a pointer to a struct usb_host_config as
      an argument; it searches for an interface with specified interface and
      alternate setting numbers in that config.  However, it crashes if the
      usb_host_config pointer argument is NULL.
      
      Since this is a general-purpose routine, available for use in many
      places, we want to to be more robust.  This patch makes it return NULL
      whenever the config argument is NULL.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: syzbot+19c3aaef85a89d451eac@syzkaller.appspotmail.com
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c9a4cb20
    • A
      USB: fix error handling in usb_driver_claim_interface() · bd729f9d
      Alan Stern 提交于
      The syzbot fuzzing project found a use-after-free bug in the USB
      core.  The bug was caused by usbfs not unbinding from an interface
      when the USB device file was closed, which led another process to
      attempt the unbind later on, after the private data structure had been
      deallocated.
      
      The reason usbfs did not unbind the interface at the appropriate time
      was because it thought the interface had never been claimed in the
      first place.  This was caused by the fact that
      usb_driver_claim_interface() does not clean up properly when
      device_bind_driver() returns an error.  Although the error code gets
      passed back to the caller, the iface->dev.driver pointer remains set
      and iface->condition remains equal to USB_INTERFACE_BOUND.
      
      This patch adds proper error handling to usb_driver_claim_interface().
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: syzbot+f84aa7209ccec829536f@syzkaller.appspotmail.com
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bd729f9d
    • A
      USB: remove LPM management from usb_driver_claim_interface() · c183813f
      Alan Stern 提交于
      usb_driver_claim_interface() disables and re-enables Link Power
      Management, but it shouldn't do either one, for the reasons listed
      below.  This patch removes the two LPM-related function calls from the
      routine.
      
      The reason for disabling LPM in the analogous function
      usb_probe_interface() is so that drivers won't have to deal with
      unwanted LPM transitions in their probe routine.  But
      usb_driver_claim_interface() doesn't call the driver's probe routine
      (or any other callbacks), so that reason doesn't apply here.
      
      Furthermore, no driver other than usbfs will ever call
      usb_driver_claim_interface() unless it is already bound to another
      interface in the same device, which means disabling LPM here would be
      redundant.  usbfs doesn't interact with LPM at all.
      
      Lastly, the error return from usb_unlocked_disable_lpm() isn't handled
      properly; the code doesn't clean up its earlier actions before
      returning.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Fixes: 8306095f ("USB: Disable USB 3.0 LPM in critical sections.")
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c183813f