<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/core/config.c, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-01-17T17:55:31Z</updated>
<entry>
<title>USB: core: prevent malicious bNumInterfaces overflow</title>
<updated>2018-01-17T17:55:31Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2017-12-12T19:25:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5b2323b62af18be000ef627f302b5bf167402de6'/>
<id>urn:sha1:5b2323b62af18be000ef627f302b5bf167402de6</id>
<content type='text'>
[ Upstream commit 48a4ff1c7bb5a32d2e396b03132d20d552c0eca7 ]

A malicious USB device with crafted descriptors can cause the kernel
to access unallocated memory by setting the bNumInterfaces value too
high in a configuration descriptor.  Although the value is adjusted
during parsing, this adjustment is skipped in one of the error return
paths.

This patch prevents the problem by setting bNumInterfaces to 0
initially.  The existing code already sets it to the proper value
after parsing is complete.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>USB: core: fix out-of-bounds access bug in usb_get_bos_descriptor()</title>
<updated>2017-11-06T04:54:34Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2017-10-18T16:49:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e4e541386c2e0221a2325fc83b18ddf683db1f29'/>
<id>urn:sha1:e4e541386c2e0221a2325fc83b18ddf683db1f29</id>
<content type='text'>
[ Upstream commit 1c0edc3633b56000e18d82fc241e3995ca18a69e ]

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: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Tested-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>USB: fix out-of-bounds in usb_set_configuration</title>
<updated>2017-11-06T04:54:21Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2017-09-19T13:07:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de5ffcc63dbdaffffd93934003fd527673f4da0a'/>
<id>urn:sha1:de5ffcc63dbdaffffd93934003fd527673f4da0a</id>
<content type='text'>
[ Upstream commit bd7a3fe770ebd8391d1c7d072ff88e9e76d063eb ]

Andrey Konovalov reported a possible out-of-bounds problem for a USB interface
association descriptor.  He writes:
	It seems there's no proper size check of a USB_DT_INTERFACE_ASSOCIATION
	descriptor. It's only checked that the size is &gt;= 2 in
	usb_parse_configuration(), so find_iad() might do out-of-bounds access
	to intf_assoc-&gt;bInterfaceCount.

And he's right, we don't check for crazy descriptors of this type very well, so
resolve this problem.  Yet another issue found by syzkaller...

Reported-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Tested-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>usb: Increase quirk delay for USB devices</title>
<updated>2017-11-06T04:54:21Z</updated>
<author>
<name>Dmitry Fleytman</name>
</author>
<published>2017-09-05T08:40:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=706ff906989d1756444b66993ff2817f1a28fcc2'/>
<id>urn:sha1:706ff906989d1756444b66993ff2817f1a28fcc2</id>
<content type='text'>
[ Upstream commit b2a542bbb3081dbd64acc8929c140d196664c406 ]

Commit e0429362ab15
("usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e")
introduced quirk to workaround an issue with some Logitech webcams.

The workaround is introducing delay for some USB operations.

According to our testing, delay introduced by original commit
is not long enough and in rare cases we still see issues described
by the aforementioned commit.

This patch increases delays introduced by original commit.
Having this patch applied we do not see those problems anymore.

Signed-off-by: Dmitry Fleytman &lt;dmitry@daynix.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>usb-core: Add LINEAR_FRAME_INTR_BINTERVAL USB quirk</title>
<updated>2017-05-17T19:07:01Z</updated>
<author>
<name>Samuel Thibault</name>
</author>
<published>2017-03-13T19:50:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed4b286d254bfd7dd777adb115c3a316eb7008ca'/>
<id>urn:sha1:ed4b286d254bfd7dd777adb115c3a316eb7008ca</id>
<content type='text'>
[ Upstream commit 3243367b209faed5c320a4e5f9a565ee2a2ba958 ]

Some USB 2.0 devices erroneously report millisecond values in
bInterval. The generic config code manages to catch most of them,
but in some cases it's not completely enough.

The case at stake here is a USB 2.0 braille device, which wants to
announce 10ms and thus sets bInterval to 10, but with the USB 2.0
computation that yields to 64ms.  It happens that one can type fast
enough to reach this interval and get the device buffers overflown,
leading to problematic latencies.  The generic config code does not
catch this case because the 64ms is considered a sane enough value.

This change thus adds a USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL quirk
to mark devices which actually report milliseconds in bInterval,
and marks Vario Ultra devices as needing it.

Signed-off-by: Samuel Thibault &lt;samuel.thibault@ens-lyon.org&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>USB: fix problems with duplicate endpoint addresses</title>
<updated>2017-03-06T22:29:09Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2016-12-19T17:03:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b0de742a1be16b76b534d088682f18cf57f012d2'/>
<id>urn:sha1:b0de742a1be16b76b534d088682f18cf57f012d2</id>
<content type='text'>
[ Upstream commit 0a8fd1346254974c3a852338508e4a4cddbb35f1 ]

When checking a new device's descriptors, the USB core does not check
for duplicate endpoint addresses.  This can cause a problem when the
sysfs files for those endpoints are created; trying to create multiple
files with the same name will provoke a WARNING:

WARNING: CPU: 2 PID: 865 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x8a/0xa0
sysfs: cannot create duplicate filename
'/devices/platform/dummy_hcd.0/usb2/2-1/2-1:64.0/ep_05'
Kernel panic - not syncing: panic_on_warn set ...

CPU: 2 PID: 865 Comm: kworker/2:1 Not tainted 4.9.0-rc7+ #34
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Workqueue: usb_hub_wq hub_event
 ffff88006bee64c8 ffffffff81f96b8a ffffffff00000001 1ffff1000d7dcc2c
 ffffed000d7dcc24 0000000000000001 0000000041b58ab3 ffffffff8598b510
 ffffffff81f968f8 ffffffff850fee20 ffffffff85cff020 dffffc0000000000
Call Trace:
 [&lt;     inline     &gt;] __dump_stack lib/dump_stack.c:15
 [&lt;ffffffff81f96b8a&gt;] dump_stack+0x292/0x398 lib/dump_stack.c:51
 [&lt;ffffffff8168c88e&gt;] panic+0x1cb/0x3a9 kernel/panic.c:179
 [&lt;ffffffff812b80b4&gt;] __warn+0x1c4/0x1e0 kernel/panic.c:542
 [&lt;ffffffff812b8195&gt;] warn_slowpath_fmt+0xc5/0x110 kernel/panic.c:565
 [&lt;ffffffff819e70ca&gt;] sysfs_warn_dup+0x8a/0xa0 fs/sysfs/dir.c:30
 [&lt;ffffffff819e7308&gt;] sysfs_create_dir_ns+0x178/0x1d0 fs/sysfs/dir.c:59
 [&lt;     inline     &gt;] create_dir lib/kobject.c:71
 [&lt;ffffffff81fa1b07&gt;] kobject_add_internal+0x227/0xa60 lib/kobject.c:229
 [&lt;     inline     &gt;] kobject_add_varg lib/kobject.c:366
 [&lt;ffffffff81fa2479&gt;] kobject_add+0x139/0x220 lib/kobject.c:411
 [&lt;ffffffff82737a63&gt;] device_add+0x353/0x1660 drivers/base/core.c:1088
 [&lt;ffffffff82738d8d&gt;] device_register+0x1d/0x20 drivers/base/core.c:1206
 [&lt;ffffffff82cb77d3&gt;] usb_create_ep_devs+0x163/0x260 drivers/usb/core/endpoint.c:195
 [&lt;ffffffff82c9f27b&gt;] create_intf_ep_devs+0x13b/0x200 drivers/usb/core/message.c:1030
 [&lt;ffffffff82ca39d3&gt;] usb_set_configuration+0x1083/0x18d0 drivers/usb/core/message.c:1937
 [&lt;ffffffff82cc9e2e&gt;] generic_probe+0x6e/0xe0 drivers/usb/core/generic.c:172
 [&lt;ffffffff82caa7fa&gt;] usb_probe_device+0xaa/0xe0 drivers/usb/core/driver.c:263

This patch prevents the problem by checking for duplicate endpoint
addresses during enumeration and skipping any duplicates.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Tested-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>USB: change bInterval default to 10 ms</title>
<updated>2016-10-03T12:34:59Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2016-09-16T14:24:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=507e166c3cdbcdeba89203fb7a9a71682370693c'/>
<id>urn:sha1:507e166c3cdbcdeba89203fb7a9a71682370693c</id>
<content type='text'>
[ Upstream commit 08c5cd37480f59ea39682f4585d92269be6b1424 ]

Some full-speed mceusb infrared transceivers contain invalid endpoint
descriptors for their interrupt endpoints, with bInterval set to 0.
In the past they have worked out okay with the mceusb driver, because
the driver sets the bInterval field in the descriptor to 1,
overwriting whatever value may have been there before.  However, this
approach was never sanctioned by the USB core, and in fact it does not
work with xHCI controllers, because they use the bInterval value that
was present when the configuration was installed.

Currently usbcore uses 32 ms as the default interval if the value in
the endpoint descriptor is invalid.  It turns out that these IR
transceivers don't work properly unless the interval is set to 10 ms
or below.  To work around this mceusb problem, this patch changes the
endpoint-descriptor parsing routine, making the default interval value
be 10 ms rather than 32 ms.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Tested-by: Wade Berrier &lt;wberrier@gmail.com&gt;
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>usb: Use the USB_SS_MULT() macro to decode burst multiplier for log message</title>
<updated>2016-01-23T04:54:11Z</updated>
<author>
<name>Ben Hutchings</name>
</author>
<published>2015-11-18T02:01:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2518cb2956c7774dcbf5f361bdd9c126ec32b310'/>
<id>urn:sha1:2518cb2956c7774dcbf5f361bdd9c126ec32b310</id>
<content type='text'>
commit 5377adb092664d336ac212499961cac5e8728794 upstream.

usb_parse_ss_endpoint_companion() now decodes the burst multiplier
correctly in order to check that it's &lt;= 3, but still uses the wrong
expression if warning that it's &gt; 3.

Fixes: ff30cbc8da42 ("usb: Use the USB_SS_MULT() macro to get the ...")
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: Use the USB_SS_MULT() macro to get the burst multiplier.</title>
<updated>2015-10-22T21:43:23Z</updated>
<author>
<name>Mathias Nyman</name>
</author>
<published>2015-09-21T14:46:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74830c233c3c2dc4b034399f3d4d029e35db9a11'/>
<id>urn:sha1:74830c233c3c2dc4b034399f3d4d029e35db9a11</id>
<content type='text'>
commit ff30cbc8da425754e8ab96904db1d295bd034f27 upstream.

Bits 1:0 of the bmAttributes are used for the burst multiplier.
The rest of the bits used to be reserved (zero), but USB3.1 takes bit 7
into use.

Use the existing USB_SS_MULT() macro instead to make sure the mult value
and hence max packet calculations are correct for USB3.1 devices.

Note that burst multiplier in bmAttributes is zero based and that
the USB_SS_MULT() macro adds one.

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-core bInterval quirk</title>
<updated>2014-08-01T22:47:05Z</updated>
<author>
<name>James P Michels III</name>
</author>
<published>2014-07-27T17:28:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cd83ce9e6195aa3ea15ab4db92892802c20df5d0'/>
<id>urn:sha1:cd83ce9e6195aa3ea15ab4db92892802c20df5d0</id>
<content type='text'>
This patch adds a usb quirk to support devices with interupt endpoints
and bInterval values expressed as microframes. The quirk causes the
parse endpoint function to modify the reported bInterval to a standards
conforming value.

There is currently code in the endpoint parser that checks for
bIntervals that are outside of the valid range (1-16 for USB 2+ high
speed and super speed interupt endpoints). In this case, the code assumes
the bInterval is being reported in 1ms frames. As well, the correction
is only applied if the original bInterval value is out of the 1-16 range.

With this quirk applied to the device, the bInterval will be
accurately adjusted from microframes to an exponent.

Signed-off-by: James P Michels III &lt;james.p.michels@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
