<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/core, branch v3.18.62</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.18.62</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.18.62'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2017-07-15T08:14:39+00:00</updated>
<entry>
<title>Add USB quirk for HVR-950q to avoid intermittent device resets</title>
<updated>2017-07-15T08:14:39+00:00</updated>
<author>
<name>Devin Heitmueller</name>
<email>dheitmueller@kernellabs.com</email>
</author>
<published>2017-06-27T17:08:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d085cd019747cc551608074fec95a30442bc8e8b'/>
<id>urn:sha1:d085cd019747cc551608074fec95a30442bc8e8b</id>
<content type='text'>
commit 6836796de4019944f4ba4c99a360e8250fd2e735 upstream.

The USB core and sysfs will attempt to enumerate certain parameters
which are unsupported by the au0828 - causing inconsistent behavior
and sometimes causing the chip to reset.  Avoid making these calls.

This problem manifested as intermittent cases where the au8522 would
be reset on analog video startup, in particular when starting up ALSA
audio streaming in parallel - the sysfs entries created by
snd-usb-audio on streaming startup would result in unsupported control
messages being sent during tuning which would put the chip into an
unknown state.

Signed-off-by: Devin Heitmueller &lt;dheitmueller@kernellabs.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: core: fix potential memory leak in error path during hcd creation</title>
<updated>2017-06-26T05:10:52+00:00</updated>
<author>
<name>Anton Bondarenko</name>
<email>anton.bondarenko.sama@gmail.com</email>
</author>
<published>2017-05-06T23:53:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=18700c3c531baa32e42a12e40501dc6223811dc4'/>
<id>urn:sha1:18700c3c531baa32e42a12e40501dc6223811dc4</id>
<content type='text'>
commit 1a744d2eb76aaafb997fda004ae3ae62a1538f85 upstream.

Free memory allocated for address0_mutex if allocation of bandwidth_mutex
failed.

Fixes: feb26ac31a2a ("usb: core: hub: hub_port_init lock controller instead of bus")

Signed-off-by: Anton Bondarenko &lt;anton.bondarenko.sama@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>USB: hub: fix SS max number of ports</title>
<updated>2017-06-26T05:10:51+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-05-10T16:18:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=097e1d5f532d0c45c3b2b4f73f4d88105337de2e'/>
<id>urn:sha1:097e1d5f532d0c45c3b2b4f73f4d88105337de2e</id>
<content type='text'>
commit 93491ced3c87c94b12220dbac0527e1356702179 upstream.

Add define for the maximum number of ports on a SuperSpeed hub as per
USB 3.1 spec Table 10-5, and use it when verifying the retrieved hub
descriptor.

This specifically avoids benign attempts to update the DeviceRemovable
mask for non-existing ports (should we get that far).

Fixes: dbe79bbe9dcb ("USB 3.0 Hub Changes")
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>USB: hub: fix non-SS hub-descriptor handling</title>
<updated>2017-05-25T12:17:59+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-05-10T16:18:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=14f378cdac38e5eda662e22875b448c4a8fedb9a'/>
<id>urn:sha1:14f378cdac38e5eda662e22875b448c4a8fedb9a</id>
<content type='text'>
commit bec444cd1c94c48df409a35ad4e5b143c245c3f7 upstream.

Add missing sanity check on the non-SuperSpeed hub-descriptor length in
order to avoid parsing and leaking two bytes of uninitialised slab data
through sysfs removable-attributes (or a compound-device debug
statement).

Note that we only make sure that the DeviceRemovable field is always
present (and specifically ignore the unused PortPwrCtrlMask field) in
order to continue support any hubs with non-compliant descriptors. As a
further safeguard, the descriptor buffer is also cleared.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
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: hub: fix SS hub-descriptor handling</title>
<updated>2017-05-25T12:17:59+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-05-10T16:18:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e6a3e9e093fca621b21f47402d94fcaefca91fd0'/>
<id>urn:sha1:e6a3e9e093fca621b21f47402d94fcaefca91fd0</id>
<content type='text'>
commit 2c25a2c818023df64463aac3288a9f969491e507 upstream.

A SuperSpeed hub descriptor does not have any variable-length fields so
bail out when reading a short descriptor.

This avoids parsing and leaking two bytes of uninitialised slab data
through sysfs removable-attributes.

Fixes: dbe79bbe9dcb ("USB 3.0 Hub Changes")
Cc: John Youn &lt;John.Youn@synopsys.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>USB: core: replace %p with %pK</title>
<updated>2017-05-25T12:17:56+00:00</updated>
<author>
<name>Vamsi Krishna Samavedam</name>
<email>vskrishn@codeaurora.org</email>
</author>
<published>2017-05-16T12:38:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2c128b70e4802fd8c999337e0aaa072d562bb92f'/>
<id>urn:sha1:2c128b70e4802fd8c999337e0aaa072d562bb92f</id>
<content type='text'>
commit 2f964780c03b73de269b08d12aff96a9618d13f3 upstream.

Format specifier %p can leak kernel addresses while not valuing the
kptr_restrict system settings. When kptr_restrict is set to (1), kernel
pointers printed using the %pK format specifier will be replaced with
Zeros. Debugging Note : &amp;pK prints only Zeros as address. If you need
actual address information, write 0 to kptr_restrict.

echo 0 &gt; /proc/sys/kernel/kptr_restrict

[Found by poking around in a random vendor kernel tree, it would be nice
if someone would actually send these types of patches upstream - gkh]

Signed-off-by: Vamsi Krishna Samavedam &lt;vskrishn@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: hub: Do not attempt to autosuspend disconnected devices</title>
<updated>2017-05-20T12:18:40+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2017-03-20T21:30:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1a39dd098f52f430513b6e59032c0971799c15e7'/>
<id>urn:sha1:1a39dd098f52f430513b6e59032c0971799c15e7</id>
<content type='text'>
commit f5cccf49428447dfbc9edb7a04bb8fc316269781 upstream.

While running a bind/unbind stress test with the dwc3 usb driver on rk3399,
the following crash was observed.

Unable to handle kernel NULL pointer dereference at virtual address 00000218
pgd = ffffffc00165f000
[00000218] *pgd=000000000174f003, *pud=000000000174f003,
				*pmd=0000000001750003, *pte=00e8000001751713
Internal error: Oops: 96000005 [#1] PREEMPT SMP
Modules linked in: uinput uvcvideo videobuf2_vmalloc cmac
ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat rfcomm
xt_mark fuse bridge stp llc zram btusb btrtl btbcm btintel bluetooth
ip6table_filter mwifiex_pcie mwifiex cfg80211 cdc_ether usbnet r8152 mii joydev
snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device ppp_async
ppp_generic slhc tun
CPU: 1 PID: 29814 Comm: kworker/1:1 Not tainted 4.4.52 #507
Hardware name: Google Kevin (DT)
Workqueue: pm pm_runtime_work
task: ffffffc0ac540000 ti: ffffffc0af4d4000 task.ti: ffffffc0af4d4000
PC is at autosuspend_check+0x74/0x174
LR is at autosuspend_check+0x70/0x174
...
Call trace:
[&lt;ffffffc00080dcc0&gt;] autosuspend_check+0x74/0x174
[&lt;ffffffc000810500&gt;] usb_runtime_idle+0x20/0x40
[&lt;ffffffc000785ae0&gt;] __rpm_callback+0x48/0x7c
[&lt;ffffffc000786af0&gt;] rpm_idle+0x1e8/0x498
[&lt;ffffffc000787cdc&gt;] pm_runtime_work+0x88/0xcc
[&lt;ffffffc000249bb8&gt;] process_one_work+0x390/0x6b8
[&lt;ffffffc00024abcc&gt;] worker_thread+0x480/0x610
[&lt;ffffffc000251a80&gt;] kthread+0x164/0x178
[&lt;ffffffc0002045d0&gt;] ret_from_fork+0x10/0x40

Source:

(gdb) l *0xffffffc00080dcc0
0xffffffc00080dcc0 is in autosuspend_check
(drivers/usb/core/driver.c:1778).
1773		/* We don't need to check interfaces that are
1774		 * disabled for runtime PM.  Either they are unbound
1775		 * or else their drivers don't support autosuspend
1776		 * and so they are permanently active.
1777		 */
1778		if (intf-&gt;dev.power.disable_depth)
1779			continue;
1780		if (atomic_read(&amp;intf-&gt;dev.power.usage_count) &gt; 0)
1781			return -EBUSY;
1782		w |= intf-&gt;needs_remote_wakeup;

Code analysis shows that intf is set to NULL in usb_disable_device() prior
to setting actconfig to NULL. At the same time, usb_runtime_idle() does not
lock the usb device, and neither does any of the functions in the
traceback. This means that there is no protection against a race condition
where usb_disable_device() is removing dev-&gt;actconfig-&gt;interface[] pointers
while those are being accessed from autosuspend_check().

To solve the problem, synchronize and validate device state between
autosuspend_check() and usb_disconnect().

Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously</title>
<updated>2017-05-20T12:18:39+00:00</updated>
<author>
<name>Ajay Kaher</name>
<email>ajay.kaher@samsung.com</email>
</author>
<published>2017-03-28T12:09:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ac2340bcf8cec0e42e1833a5951bfadf42a87d7c'/>
<id>urn:sha1:ac2340bcf8cec0e42e1833a5951bfadf42a87d7c</id>
<content type='text'>
commit 2f86a96be0ccb1302b7eee7855dbee5ce4dc5dfb upstream.

There is race condition when two USB class drivers try to call
init_usb_class at the same time and leads to crash.
code path: probe-&gt;usb_register_dev-&gt;init_usb_class

To solve this, mutex locking has been added in init_usb_class() and
destroy_usb_class().

As pointed by Alan, removed "if (usb_class)" test from destroy_usb_class()
because usb_class can never be NULL there.

Signed-off-by: Ajay Kaher &lt;ajay.kaher@samsung.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 linked-list corruption in rh_call_control()</title>
<updated>2017-04-18T05:55:54+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2017-03-24T17:38:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0eccbfbc3078d4dbb981e0f6b78846eeedd2613b'/>
<id>urn:sha1:0eccbfbc3078d4dbb981e0f6b78846eeedd2613b</id>
<content type='text'>
commit 1633682053a7ee8058e10c76722b9b28e97fb73f upstream.

Using KASAN, Dmitry found a bug in the rh_call_control() routine: If
buffer allocation fails, the routine returns immediately without
unlinking its URB from the control endpoint, eventually leading to
linked-list corruption.

This patch fixes the problem by jumping to the end of the routine
(where the URB is unlinked) when an allocation failure occurs.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-and-tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: hub: Fix crash after failure to read BOS descriptor</title>
<updated>2017-04-18T05:55:54+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2017-03-08T18:19:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=21fd1700aa0e18121d55c13039566af95d51a95a'/>
<id>urn:sha1:21fd1700aa0e18121d55c13039566af95d51a95a</id>
<content type='text'>
commit 7b2db29fbb4e766fcd02207eb2e2087170bd6ebc upstream.

If usb_get_bos_descriptor() returns an error, usb-&gt;bos will be NULL.
Nevertheless, it is dereferenced unconditionally in
hub_set_initial_usb2_lpm_policy() if usb2_hw_lpm_capable is set.
This results in a crash.

usb 5-1: unable to get BOS descriptor
...
Unable to handle kernel NULL pointer dereference at virtual address 00000008
pgd = ffffffc00165f000
[00000008] *pgd=000000000174f003, *pud=000000000174f003,
		*pmd=0000000001750003, *pte=00e8000001751713
Internal error: Oops: 96000005 [#1] PREEMPT SMP
Modules linked in: uinput uvcvideo videobuf2_vmalloc cmac [ ... ]
CPU: 5 PID: 3353 Comm: kworker/5:3 Tainted: G    B 4.4.52 #480
Hardware name: Google Kevin (DT)
Workqueue: events driver_set_config_work
task: ffffffc0c3690000 ti: ffffffc0ae9a8000 task.ti: ffffffc0ae9a8000
PC is at hub_port_init+0xc3c/0xd10
LR is at hub_port_init+0xc3c/0xd10
...
Call trace:
[&lt;ffffffc0007fbbfc&gt;] hub_port_init+0xc3c/0xd10
[&lt;ffffffc0007fbe2c&gt;] usb_reset_and_verify_device+0x15c/0x82c
[&lt;ffffffc0007fc5e0&gt;] usb_reset_device+0xe4/0x298
[&lt;ffffffbffc0e3fcc&gt;] rtl8152_probe+0x84/0x9b0 [r8152]
[&lt;ffffffc00080ca8c&gt;] usb_probe_interface+0x244/0x2f8
[&lt;ffffffc000774a24&gt;] driver_probe_device+0x180/0x3b4
[&lt;ffffffc000774e48&gt;] __device_attach_driver+0xb4/0xe0
[&lt;ffffffc000772168&gt;] bus_for_each_drv+0xb4/0xe4
[&lt;ffffffc0007747ec&gt;] __device_attach+0xd0/0x158
[&lt;ffffffc000775080&gt;] device_initial_probe+0x24/0x30
[&lt;ffffffc0007739d4&gt;] bus_probe_device+0x50/0xe4
[&lt;ffffffc000770bd0&gt;] device_add+0x414/0x738
[&lt;ffffffc000809fe8&gt;] usb_set_configuration+0x89c/0x914
[&lt;ffffffc00080a120&gt;] driver_set_config_work+0xc0/0xf0
[&lt;ffffffc000249bb8&gt;] process_one_work+0x390/0x6b8
[&lt;ffffffc00024abcc&gt;] worker_thread+0x480/0x610
[&lt;ffffffc000251a80&gt;] kthread+0x164/0x178
[&lt;ffffffc0002045d0&gt;] ret_from_fork+0x10/0x40

Since we don't know anything about LPM capabilities without BOS descriptor,
don't attempt to enable LPM if it is not available.

Fixes: 890dae886721 ("xhci: Enable LPM support only for hardwired ...")
Cc: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Acked-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
