<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/drivers/usb, branch dev-5.14-intel</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-5.14-intel</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-5.14-intel'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2021-10-19T22:10:34+00:00</updated>
<entry>
<title>USB: gadget: fix illegal array access in binding with UDC</title>
<updated>2021-10-19T22:10:34+00:00</updated>
<author>
<name>Kyungtae Kim</name>
<email>kt0755@gmail.com</email>
</author>
<published>2020-05-10T05:43:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=3834b0f97ac202ddfd0a9e6aae14a3255ab976ab'/>
<id>urn:sha1:3834b0f97ac202ddfd0a9e6aae14a3255ab976ab</id>
<content type='text'>
FuzzUSB (a variant of syzkaller) found an illegal array access
using an incorrect index while binding a gadget with UDC.

Reference: https://www.spinics.net/lists/linux-usb/msg194331.html

This bug occurs when a size variable used for a buffer
is misused to access its strcpy-ed buffer.
Given a buffer along with its size variable (taken from user input),
from which, a new buffer is created using kstrdup().
Due to the original buffer containing 0 value in the middle,
the size of the kstrdup-ed buffer becomes smaller than that of the original.
So accessing the kstrdup-ed buffer with the same size variable
triggers memory access violation.

The fix makes sure no zero value in the buffer,
by comparing the strlen() of the orignal buffer with the size variable,
so that the access to the kstrdup-ed buffer is safe.

BUG: KASAN: slab-out-of-bounds in gadget_dev_desc_UDC_store+0x1ba/0x200
drivers/usb/gadget/configfs.c:266
Read of size 1 at addr ffff88806a55dd7e by task syz-executor.0/17208

CPU: 2 PID: 17208 Comm: syz-executor.0 Not tainted 5.6.8 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0xce/0x128 lib/dump_stack.c:118
 print_address_description.constprop.4+0x21/0x3c0 mm/kasan/report.c:374
 __kasan_report+0x131/0x1b0 mm/kasan/report.c:506
 kasan_report+0x12/0x20 mm/kasan/common.c:641
 __asan_report_load1_noabort+0x14/0x20 mm/kasan/generic_report.c:132
 gadget_dev_desc_UDC_store+0x1ba/0x200 drivers/usb/gadget/configfs.c:266
 flush_write_buffer fs/configfs/file.c:251 [inline]
 configfs_write_file+0x2f1/0x4c0 fs/configfs/file.c:283
 __vfs_write+0x85/0x110 fs/read_write.c:494
 vfs_write+0x1cd/0x510 fs/read_write.c:558
 ksys_write+0x18a/0x220 fs/read_write.c:611
 __do_sys_write fs/read_write.c:623 [inline]
 __se_sys_write fs/read_write.c:620 [inline]
 __x64_sys_write+0x73/0xb0 fs/read_write.c:620
 do_syscall_64+0x9e/0x510 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Signed-off-by: Kyungtae Kim &lt;kt0755@gmail.com&gt;
Reported-and-tested-by: Kyungtae Kim &lt;kt0755@gmail.com&gt;
Cc: Felipe Balbi &lt;balbi@kernel.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20200510054326.GA19198@pizza01
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Add IO statistics to USB Mass storage gadget</title>
<updated>2021-10-19T22:10:32+00:00</updated>
<author>
<name>Adrian Ambrożewicz</name>
<email>adrian.ambrozewicz@intel.com</email>
</author>
<published>2019-07-29T08:19:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=04d67d86b73e3dcf52e18ae7fa8c866bae74db2a'/>
<id>urn:sha1:04d67d86b73e3dcf52e18ae7fa8c866bae74db2a</id>
<content type='text'>
Introduces new attribute to Mass Storage Gadget ConfigFS : stats.
It's read-only attribute which contains statistics of read/write operations
based on LUN transaction counters (IO number and bytes transferred).

Goal is to provide a way to observe whether simulated device is actually
used by host. Statistics on hosted file / nbd level are not always viable
due to page cache having severe impact on actual IO statistics.
This attribute should provide information about host IO on USB Gadget as
close to endpoint as possible.

Attribute is tied completely to configFS implementation and it's lifecycle
is managed by Kernel and user. Driver implements a handler which populates
output buffer on read.

Tests performed:
- mounted USB Mass Storage gadget, new attribute showed up in gadget tree
- attribute was monitored for changes during IO performed on host machine
- removed device, attribute (along with other device attributes) was gone

Signed-off-by: Adrian Ambrożewicz &lt;adrian.ambrozewicz@intel.com&gt;
</content>
</entry>
<entry>
<title>Suppress excessive HID gadget error logs</title>
<updated>2021-10-19T22:10:31+00:00</updated>
<author>
<name>Jae Hyun Yoo</name>
<email>jae.hyun.yoo@intel.com</email>
</author>
<published>2019-03-18T21:06:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=7eb660c75f65a25741d0b44f71836e9441c9d09c'/>
<id>urn:sha1:7eb660c75f65a25741d0b44f71836e9441c9d09c</id>
<content type='text'>
HID events can be sent even when the host disconnects the HID
device according to the current graphic mode. For an example, if
KVM mouse events are sent when the host is in text mode, queueing
of end point messages will be dropped with this message:

configfs-gadget gadget: usb_ep_queue error on int endpoint -108

This case is very usual case in BMC since BMC can control power
status of the host, so this commit suppress the error printing outs
with making HID gadget driver drop events quietly in the case.

This should be a downstream only customization. Do not upstream it.

Signed-off-by: Jae Hyun Yoo &lt;jae.hyun.yoo@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v5.14.11' into dev-5.14</title>
<updated>2021-10-11T05:22:51+00:00</updated>
<author>
<name>Joel Stanley</name>
<email>joel@jms.id.au</email>
</author>
<published>2021-10-11T05:22:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=d9563a2fe5e92439bbb1513482702d3eec520de8'/>
<id>urn:sha1:d9563a2fe5e92439bbb1513482702d3eec520de8</id>
<content type='text'>
This is the 5.14.11 stable release

Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>usb: ehci: Handshake CMD_RUN instead of STS_HALT for Aspeed</title>
<updated>2021-10-11T05:13:56+00:00</updated>
<author>
<name>Neal Liu</name>
<email>neal_liu@aspeedtech.com</email>
</author>
<published>2021-09-10T07:36:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=272f4ba9db04f60f8d69a753f817861844d45883'/>
<id>urn:sha1:272f4ba9db04f60f8d69a753f817861844d45883</id>
<content type='text'>
For Aspeed, HCHalted status depends on not only Run/Stop but also
ASS/PSS status.

Handshake CMD_RUN on startup instead.

OpenBMC-Staging-Count: 1
Signed-off-by: Neal Liu &lt;neal_liu@aspeedtech.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reviewed-by: Tao Ren &lt;rentao.bupt@gmail.com&gt;
Tested-by: Tao Ren &lt;rentao.bupt@gmail.com&gt;
Reviewed-by: Joel Stanley &lt;joel@jms.id.au&gt;
Fixes: 280a9045bb18 ("ehci: fix EHCI host controller initialization sequence")
Link: https://lore.kernel.org/r/20210910073619.26095-1-neal_liu@aspeedtech.com
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: check return value after calling platform_get_resource()</title>
<updated>2021-10-09T13:02:39+00:00</updated>
<author>
<name>Yang Yingliang</name>
<email>yangyingliang@huawei.com</email>
</author>
<published>2021-08-31T08:42:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=337f00a0bc62d7cb7d10ec0b872c79009a1641df'/>
<id>urn:sha1:337f00a0bc62d7cb7d10ec0b872c79009a1641df</id>
<content type='text'>
[ Upstream commit 856e6e8e0f9300befa87dde09edb578555c99a82 ]

It will cause null-ptr-deref if platform_get_resource() returns NULL,
we need check the return value.

Signed-off-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Link: https://lore.kernel.org/r/20210831084236.1359677-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: Populate SS descriptors' wBytesPerInterval</title>
<updated>2021-09-30T08:13:08+00:00</updated>
<author>
<name>Jack Pham</name>
<email>jackp@codeaurora.org</email>
</author>
<published>2021-09-09T17:48:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=f6fceb4e9ce6af58ddddfb0bad6b52da4f28dfaf'/>
<id>urn:sha1:f6fceb4e9ce6af58ddddfb0bad6b52da4f28dfaf</id>
<content type='text'>
commit f0e8a206a2a53a919e1709c654cb65d519f7befb upstream.

For Isochronous endpoints, the SS companion descriptor's
wBytesPerInterval field is required to reserve bus time in order
to transmit the required payload during the service interval.
If left at 0, the UAC2 function is unable to transact data on its
playback or capture endpoints in SuperSpeed mode.

Since f_uac2 currently does not support any bursting this value can
be exactly equal to the calculated wMaxPacketSize.

Tested with Windows 10 as a host.

Fixes: f8cb3d556be3 ("usb: f_uac2: adds support for SS and SSP")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Jack Pham &lt;jackp@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20210909174811.12534-3-jackp@codeaurora.org
[jackp: Backport to 5.14 with minor conflict resolution]
Signed-off-by: Jack Pham &lt;jackp@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: Add missing companion descriptor for feedback EP</title>
<updated>2021-09-30T08:13:08+00:00</updated>
<author>
<name>Jack Pham</name>
<email>jackp@codeaurora.org</email>
</author>
<published>2021-09-09T17:48:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=007574d6ac2642457e908f29c88a417b28e69fa5'/>
<id>urn:sha1:007574d6ac2642457e908f29c88a417b28e69fa5</id>
<content type='text'>
commit 595091a1426a3b2625dad322f69fe569dc9d8943 upstream.

The f_uac2 function fails to enumerate when connected in SuperSpeed
due to the feedback endpoint missing the companion descriptor.
Add a new ss_epin_fback_desc_comp descriptor and append it behind the
ss_epin_fback_desc both in the static definition of the ss_audio_desc
structure as well as its dynamic construction in setup_headers().

Fixes: 24f779dac8f3 ("usb: gadget: f_uac2/u_audio: add feedback endpoint support")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Jack Pham &lt;jackp@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20210909174811.12534-2-jackp@codeaurora.org
[jackp: Backport to 5.14 with minor conflict resolution]
Signed-off-by: Jack Pham &lt;jackp@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: serial: cp210x: fix dropped characters with CP2102</title>
<updated>2021-09-30T08:13:07+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2021-09-22T11:30:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=62a27861b4ea5f5611be01d93c2a2f4498fc4f1b'/>
<id>urn:sha1:62a27861b4ea5f5611be01d93c2a2f4498fc4f1b</id>
<content type='text'>
commit c32dfec6c1c36bbbcd5d33e949d99aeb215877ec upstream.

Some CP2102 do not support event-insertion mode but return no error when
attempting to enable it.

This means that any event escape characters in the input stream will not
be escaped by the device and consequently regular data may be
interpreted as escape sequences and be removed from the stream by the
driver.

The reporter's device has batch number DCL00X etched into it and as
discovered by the SHA2017 Badge team, counterfeit devices with that
marking can be detected by sending malformed vendor requests. [1][2]

Tests confirm that the possibly counterfeit CP2102 returns a single byte
in response to a malformed two-byte part-number request, while an
original CP2102 returns two bytes. Assume that every CP2102 that behaves
this way also does not support event-insertion mode (e.g. cannot report
parity errors).

[1] https://mobile.twitter.com/sha2017badge/status/1167902087289532418
[2] https://hackaday.com/2017/08/14/hands-on-with-the-shacamp-2017-badge/#comment-3903376

Reported-by: Malte Di Donato &lt;malte@neo-soft.org&gt;
Tested-by: Malte Di Donato &lt;malte@neo-soft.org&gt;
Fixes: a7207e9835a4 ("USB: serial: cp210x: add support for line-status events")
Cc: stable@vger.kernel.org	# 5.9
Link: https://lore.kernel.org/r/20210922113100.20888-1-johan@kernel.org
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>xhci: Set HCD flag to defer primary roothub registration</title>
<updated>2021-09-30T08:12:56+00:00</updated>
<author>
<name>Kishon Vijay Abraham I</name>
<email>kishon@ti.com</email>
</author>
<published>2021-09-09T06:41:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=807ac762afee3b88f17354327c74d986e7489b8a'/>
<id>urn:sha1:807ac762afee3b88f17354327c74d986e7489b8a</id>
<content type='text'>
commit b7a0a792f864583207c593b50fd1b752ed89f4c1 upstream.

Set "HCD_FLAG_DEFER_RH_REGISTER" to hcd-&gt;flags in xhci_run() to defer
registering primary roothub in usb_add_hcd(). This will make sure both
primary roothub and secondary roothub will be registered along with the
second HCD. This is required for cold plugged USB devices to be detected
in certain PCIe USB cards (like Inateck USB card connected to AM64 EVM
or J7200 EVM).

CC: stable@vger.kernel.org # 5.4+
Suggested-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Tested-by: Chris Chiu &lt;chris.chiu@canonical.com&gt;
Signed-off-by: Kishon Vijay Abraham I &lt;kishon@ti.com&gt;
Link: https://lore.kernel.org/r/20210909064200.16216-3-kishon@ti.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
