Skip to content
  1. Apr 13, 2016
  2. Mar 05, 2016
    • Reilly Grant's avatar
      usb: devio: Add ioctl to disallow detaching kernel USB drivers. · d883f52e
      Reilly Grant authored
      
      
      The new USBDEVFS_DROP_PRIVILEGES ioctl allows a process to voluntarily
      relinquish the ability to issue other ioctls that may interfere with
      other processes and drivers that have claimed an interface on the
      device.
      
      This commit also includes a simple utility to be able to test the
      ioctl, located at Documentation/usb/usbdevfs-drop-permissions.c
      
      Example (with qemu-kvm's input device):
      
          $ lsusb
          ...
          Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd
      
          $ usb-devices
          ...
          C:  #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
          I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=02 Driver=usbhid
      
          $ sudo ./usbdevfs-drop-permissions /dev/bus/usb/001/002
          OK: privileges dropped!
          Available options:
          [0] Exit now
          [1] Reset device. Should fail if device is in use
          [2] Claim 4 interfaces. Should succeed where not in use
          [3] Narrow interface permission mask
          Which option shall I run?: 1
          ERROR: USBDEVFS_RESET failed! (1 - Operation not permitted)
          Which test shall I run next?: 2
          ERROR claiming if 0 (1 - Operation not permitted)
          ERROR claiming if 1 (1 - Operation not permitted)
          ERROR claiming if 2 (1 - Operation not permitted)
          ERROR claiming if 3 (1 - Operation not permitted)
          Which test shall I run next?: 0
      
      After unbinding usbhid:
      
          $ usb-devices
          ...
          I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=02 Driver=(none)
      
          $ sudo ./usbdevfs-drop-permissions /dev/bus/usb/001/002
          ...
          Which option shall I run?: 2
          OK: claimed if 0
          ERROR claiming if 1 (1 - Operation not permitted)
          ERROR claiming if 2 (1 - Operation not permitted)
          ERROR claiming if 3 (1 - Operation not permitted)
          Which test shall I run next?: 1
          OK: USBDEVFS_RESET succeeded
          Which test shall I run next?: 0
      
      After unbinding usbhid and restricting the mask:
      
          $ sudo ./usbdevfs-drop-permissions /dev/bus/usb/001/002
          ...
          Which option shall I run?: 3
          Insert new mask: 0
          OK: privileges dropped!
          Which test shall I run next?: 2
          ERROR claiming if 0 (1 - Operation not permitted)
          ERROR claiming if 1 (1 - Operation not permitted)
          ERROR claiming if 2 (1 - Operation not permitted)
          ERROR claiming if 3 (1 - Operation not permitted)
      
      Signed-off-by: default avatarReilly Grant <reillyg@chromium.org>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarEmilio López <emilio.lopez@collabora.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d883f52e
  3. Mar 04, 2016
  4. Dec 24, 2015
  5. Dec 16, 2015
  6. Dec 15, 2015
  7. Dec 01, 2015
    • Lu Baolu's avatar
      usb: core: lpm: fix usb3_hardware_lpm sysfs node · bf5ce5bf
      Lu Baolu authored
      
      
      Commit 655fe4ef ("usbcore: add sysfs support to xHCI usb3
      hardware LPM") introduced usb3_hardware_lpm sysfs node. This
      doesn't show the correct status of USB3 U1 and U2 LPM status.
      
      This patch fixes this by replacing usb3_hardware_lpm with two
      nodes, usb3_hardware_lpm_u1 (for U1) and usb3_hardware_lpm_u2
      (for U2), and recording the U1/U2 LPM status in right places.
      
      This patch should be back-ported to kernels as old as 4.3,
      that contains Commit 655fe4ef ("usbcore: add sysfs support
      to xHCI usb3 hardware LPM").
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bf5ce5bf
  8. Sep 22, 2015
  9. Aug 18, 2015
  10. Aug 14, 2015
  11. Jul 31, 2015
  12. Jul 22, 2015
  13. May 07, 2015
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: rndis: remove the limit of available rndis connections · d6d22922
      Andrzej Pietrasiewicz authored
      
      
      RNDIS function has a limitation on the number of allowed instances.
      So far it has been RNDIS_MAX_CONFIGS, which happens to be one.
      In order to eliminate this kind of arbitrary limitation we should not
      preallocate a predefined (RNDIS_MAX_CONFIGS) array of struct rndis_params
      instances but instead allow allocating them on demand.
      
      This patch allocates struct rndis_params on demand in rndis_register().
      Coversly, the structure is free()'d in rndis_deregister().
      If CONFIG_USB_GADGET_DEBUG_FILES is set, the proc files are created which
      is the same behaviour as before, but the moment of creation is delayed
      until struct rndis_params is actually allocated.
      
      rnids_init() and rndis_exit() have nothing to do, so they are eliminated.
      
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      d6d22922
    • H. Nikolaus Schaller's avatar
      Documentation usb serial: fixed how to provide vendor and product id · e3aa205a
      H. Nikolaus Schaller authored
      While trying to test a Cinterion GSM/GPS/3G module I had reconfigured
      the USB interface by mistake and therefore needed to run a different
      USB driver than CDC-ACM. It turned out that I need the "usbserial" driver.
      
      This file is an official description how to use it:
      Documentation/usb/usb-serial.txt
      
      But it is outdated. The parameters vendor= and product= have been
      superseded by a /sys interface.
      
      Here was the solution:
      
      https://bbs.archlinux.org/viewtopic.php?id=175499
      
      
      
        insmod usbserial vendor=0x#### product=0x####
      
      becomes (first #### is vendor, second is product)
      
        modprobe usbserial
        echo #### #### >/sys/bus/usb-serial/drivers/generic/new_id
      
      This patch changes the documentation file to describe the modern variant.
      Please note that the old one still works (if compiled as module).
      
      Signed-off-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: default avatarMarek Belisko <marek@goldelico.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      e3aa205a
  14. Apr 27, 2015
  15. Mar 18, 2015
  16. Mar 10, 2015
  17. Jan 12, 2015
  18. Jan 09, 2015
  19. Jan 02, 2015
Loading