<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/core, branch v4.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.6</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-05-02T15:44:31Z</updated>
<entry>
<title>Revert "USB / PM: Allow USB devices to remain runtime-suspended when sleeping"</title>
<updated>2016-05-02T15:44:31Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2016-05-02T13:35:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9be427efc764464fbcbc1ca3f0d34f575cb0f037'/>
<id>urn:sha1:9be427efc764464fbcbc1ca3f0d34f575cb0f037</id>
<content type='text'>
This reverts commit e3345db85068ddb937fc0ba40dfc39c293dad977, which
broke system resume for a large class of devices.

Devices that after having been reset during resume need to be rebound
due to a missing reset_resume callback, are now left in a suspended
state. This specifically broke resume of common USB-serial devices,
which are now unusable after system suspend (until disconnected and
reconnected) when USB persist is enabled.

During resume, usb_resume_interface will set the needs_binding flag for
such interfaces, but unlike system resume, run-time resume does not
honour it.

Cc: stable &lt;stable@vger.kernel.org&gt;	# 4.5
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: hcd: out of bounds access in for_each_companion</title>
<updated>2016-04-13T19:06:18Z</updated>
<author>
<name>Robert Dobrowolski</name>
<email>robert.dobrowolski@linux.intel.com</email>
</author>
<published>2016-03-24T10:30:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e86103a75705c7c530768f4ffaba74cf382910f2'/>
<id>urn:sha1:e86103a75705c7c530768f4ffaba74cf382910f2</id>
<content type='text'>
On BXT platform Host Controller and Device Controller figure as
same PCI device but with different device function. HCD should
not pass data to Device Controller but only to Host Controllers.
Checking if companion device is Host Controller, otherwise skip.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Robert Dobrowolski &lt;robert.dobrowolski@linux.intel.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: fix regression in SuperSpeed endpoint descriptor parsing</title>
<updated>2016-03-31T04:57:58Z</updated>
<author>
<name>Mathias Nyman</name>
<email>mathias.nyman@linux.intel.com</email>
</author>
<published>2016-03-29T10:47:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=59b9023c356c54e5f468029fa504461d04c0f02b'/>
<id>urn:sha1:59b9023c356c54e5f468029fa504461d04c0f02b</id>
<content type='text'>
commit b37d83a6a414 ("usb: Parse the new USB 3.1 SuperSpeedPlus Isoc
endpoint companion descriptor") caused a regression in 4.6-rc1 and fails
to parse SuperSpeed endpoint companion descriptors.

The new SuperSpeedPlus Isoc endpoint companion parsing code incorrectly
decreased the the remaining buffer size before comparing the size with the
expected length of the descriptor.

This lead to possible failure in reading the SuperSpeed endpoint companion
descriptor of the last endpoint, displaying a message like:

"No SuperSpeed endpoint companion for config 1 interface 0 altsetting 0
 ep 129: using minimum values"

Fix it by decreasing the size after comparing it.
Also finish all the SS endpoint companion parsing before calling SSP isoc
endpoint parsing function.

Fixes: b37d83a6a414
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: usb_driver_claim_interface: add sanity checking</title>
<updated>2016-03-18T16:19:02Z</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2016-03-16T12:26:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0b818e3956fc1ad976bee791eadcbb3b5fec5bfd'/>
<id>urn:sha1:0b818e3956fc1ad976bee791eadcbb3b5fec5bfd</id>
<content type='text'>
Attacks that trick drivers into passing a NULL pointer
to usb_driver_claim_interface() using forged descriptors are
known. This thwarts them by sanity checking.

Signed-off-by: Oliver Neukum &lt;ONeukum@suse.com&gt;
CC: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb/core: usb_alloc_dev(): fix setting of -&gt;portnum</title>
<updated>2016-03-18T16:19:02Z</updated>
<author>
<name>Nicolai Stange</name>
<email>nicstange@gmail.com</email>
</author>
<published>2016-03-17T22:53:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7222c832254a75dcd67d683df75753d4a4e125bb'/>
<id>urn:sha1:7222c832254a75dcd67d683df75753d4a4e125bb</id>
<content type='text'>
With commit 69bec7259853 ("USB: core: let USB device know device node"),
the port1 argument of usb_alloc_dev() gets overwritten as follows:

  ... usb_alloc_dev(..., unsigned port1)
  {
    ...
    if (!parent-&gt;parent) {
      port1 = usb_hcd_find_raw_port_number(..., port1);
    }
    ...
  }

Later on, this now overwritten port1 gets assigned to -&gt;portnum:

  dev-&gt;portnum = port1;

However, since xhci_find_raw_port_number() isn't idempotent, the
aforementioned commit causes a number of KASAN splats like the following:

  BUG: KASAN: slab-out-of-bounds in xhci_find_raw_port_number+0x98/0x170
                                       at addr ffff8801d9311670
  Read of size 8 by task kworker/2:1/87
  [...]
  Workqueue: usb_hub_wq hub_event
   0000000000000188 000000005814b877 ffff8800cba17588 ffffffff8191447e
   0000000041b58ab3 ffffffff82a03209 ffffffff819143a2 ffffffff82a252f4
   ffff8801d93115e0 0000000000000188 ffff8801d9311628 ffff8800cba17588
  Call Trace:
   [&lt;ffffffff8191447e&gt;] dump_stack+0xdc/0x15e
   [&lt;ffffffff819143a2&gt;] ? _atomic_dec_and_lock+0xa2/0xa2
   [&lt;ffffffff814e2cd1&gt;] ? print_section+0x61/0xb0
   [&lt;ffffffff814e4939&gt;] print_trailer+0x179/0x2c0
   [&lt;ffffffff814f0d84&gt;] object_err+0x34/0x40
   [&lt;ffffffff814f4388&gt;] kasan_report_error+0x2f8/0x8b0
   [&lt;ffffffff814eb91e&gt;] ? __slab_alloc+0x5e/0x90
   [&lt;ffffffff812178c0&gt;] ? __lock_is_held+0x90/0x130
   [&lt;ffffffff814f5091&gt;] kasan_report+0x71/0xa0
   [&lt;ffffffff814ec082&gt;] ? kmem_cache_alloc_trace+0x212/0x560
   [&lt;ffffffff81d99468&gt;] ? xhci_find_raw_port_number+0x98/0x170
   [&lt;ffffffff814f33d4&gt;] __asan_load8+0x64/0x70
   [&lt;ffffffff81d99468&gt;] xhci_find_raw_port_number+0x98/0x170
   [&lt;ffffffff81db0105&gt;] xhci_setup_addressable_virt_dev+0x235/0xa10
   [&lt;ffffffff81d9ea51&gt;] xhci_setup_device+0x3c1/0x1430
   [&lt;ffffffff8121cddd&gt;] ? trace_hardirqs_on+0xd/0x10
   [&lt;ffffffff81d9fac0&gt;] ? xhci_setup_device+0x1430/0x1430
   [&lt;ffffffff81d9fad3&gt;] xhci_address_device+0x13/0x20
   [&lt;ffffffff81d2081a&gt;] hub_port_init+0x55a/0x1550
   [&lt;ffffffff81d28705&gt;] hub_event+0xef5/0x24d0
   [&lt;ffffffff81d27810&gt;] ? hub_port_debounce+0x2f0/0x2f0
   [&lt;ffffffff8195e1ee&gt;] ? debug_object_deactivate+0x1be/0x270
   [&lt;ffffffff81210203&gt;] ? print_rt_rq+0x53/0x2d0
   [&lt;ffffffff8121657d&gt;] ? trace_hardirqs_off+0xd/0x10
   [&lt;ffffffff8226acfb&gt;] ? _raw_spin_unlock_irqrestore+0x5b/0x60
   [&lt;ffffffff81250000&gt;] ? irq_domain_set_hwirq_and_chip+0x30/0xb0
   [&lt;ffffffff81256339&gt;] ? debug_lockdep_rcu_enabled+0x39/0x40
   [&lt;ffffffff812178c0&gt;] ? __lock_is_held+0x90/0x130
   [&lt;ffffffff81196877&gt;] process_one_work+0x567/0xec0
  [...]

Afterwards, xhci reports some functional errors:

  xhci_hcd 0000:00:14.0: ERROR: unexpected setup address command completion
                                code 0x11.
  xhci_hcd 0000:00:14.0: ERROR: unexpected setup address command completion
                                code 0x11.
  usb 4-3: device not accepting address 2, error -22

Fix this by not overwriting the port1 argument in usb_alloc_dev(), but
storing the raw port number as required by OF in an additional variable,
raw_port.

Fixes: 69bec7259853 ("USB: core: let USB device know device node")
Signed-off-by: Nicolai Stange &lt;nicstange@gmail.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'usb-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb</title>
<updated>2016-03-17T21:24:26Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-03-17T21:24:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48d10bda1f2c69980601a61194015bb0790fb7ab'/>
<id>urn:sha1:48d10bda1f2c69980601a61194015bb0790fb7ab</id>
<content type='text'>
Pull USB updates from Greg KH:
 "Here is the big USB patchset for 4.6-rc1.

  The normal mess is here, gadget and xhci fixes and updates, and lots
  of other driver updates and cleanups as well.  Full details are in the
  shortlog.

  All have been in linux-next for a while with no reported issues"

* tag 'usb-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (266 commits)
  USB: core: let USB device know device node
  usb: devio: Add ioctl to disallow detaching kernel USB drivers.
  usb: gadget: f_acm: Fix configfs attr name
  usb: udc: lpc32xx: remove USB PLL and USB OTG clock management
  usb: udc: lpc32xx: remove direct access to clock controller registers
  usb: udc: lpc32xx: switch to clock prepare/unprepare model
  usb: renesas_usbhs: gadget: fix giveback status code in usbhsg_pipe_disable()
  usb: gadget: renesas_usb3: Use ARCH_RENESAS
  usb: dwc2: Fix issues in dwc2_complete_non_isoc_xfer_ddma()
  usb: dwc2: Add support for Lantiq ARX and XRX SoCs
  usb: phy: generic: Handle late registration of gadget
  usb: gadget: bdc_udc: fix race condition in bdc_udc_exit()
  usb: musb: core: added missing const qualifier to musb_hdrc_platform_data::config
  usb: dwc2: Move host-specific core functions into hcd.c
  usb: dwc2: Move register save and restore functions
  usb: dwc2: Use kmem_cache_free()
  usb: dwc2: host: If using uframe scheduler, end splits better
  usb: dwc2: host: Totally redo the microframe scheduler
  usb: dwc2: host: Properly set even/odd frame
  usb: dwc2: host: Add dwc2_hcd_get_future_frame_number() call
  ...
</content>
</entry>
<entry>
<title>USB: core: let USB device know device node</title>
<updated>2016-03-05T20:05:01Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2016-02-19T09:26:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=69bec725985324e79b1c47ea287815ac4ddb0521'/>
<id>urn:sha1:69bec725985324e79b1c47ea287815ac4ddb0521</id>
<content type='text'>
Although most of USB devices are hot-plug's, there are still some devices
are hard wired on the board, eg, for HSIC and SSIC interface USB devices.
If these kinds of USB devices are multiple functions, and they can supply
other interfaces like i2c, gpios for other devices, we may need to
describe these at device tree.

In this commit, it uses "reg" in dts as physical port number to match
the phyiscal port number decided by USB core, if they are the same,
then the device node is for the device we are creating for USB core.

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Acked-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: devio: Add ioctl to disallow detaching kernel USB drivers.</title>
<updated>2016-03-05T20:05:01Z</updated>
<author>
<name>Reilly Grant</name>
<email>reillyg@chromium.org</email>
</author>
<published>2016-02-21T21:38:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d883f52e1f6d2eca8378e3795f333c1396943873'/>
<id>urn:sha1:d883f52e1f6d2eca8378e3795f333c1396943873</id>
<content type='text'>
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: Reilly Grant &lt;reillyg@chromium.org&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Emilio López &lt;emilio.lopez@collabora.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: hub: fix a typo in hub_port_init() leading to wrong logic</title>
<updated>2016-03-04T03:44:06Z</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2016-02-17T10:52:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d5ce778c43bf888328231bcdce05d5c860655aa'/>
<id>urn:sha1:0d5ce778c43bf888328231bcdce05d5c860655aa</id>
<content type='text'>
A typo of j for i led to a logic bug. To rule out future
confusion, the variable names are made meaningful.

Signed-off-by: Oliver Neukum &lt;ONeukum@suse.com&gt;
CC: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 4.5-rc6 into usb-next</title>
<updated>2016-03-02T00:13:54Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2016-03-02T00:13:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=71e41bbb43794e0fe4ce3b766d713e222ccfb5ea'/>
<id>urn:sha1:71e41bbb43794e0fe4ce3b766d713e222ccfb5ea</id>
<content type='text'>
We want the USB fixes in here as well.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
