<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/gadget, branch linux-5.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-08-17T12:41:48Z</updated>
<entry>
<title>usb: aspeed-vhub: Fix refcount leak bug in ast_vhub_init_desc()</title>
<updated>2022-08-17T12:41:48Z</updated>
<author>
<name>Liang He</name>
</author>
<published>2022-07-13T12:05:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e0a40c803643f4edc30f0660f2f3bea4d57a99a'/>
<id>urn:sha1:0e0a40c803643f4edc30f0660f2f3bea4d57a99a</id>
<content type='text'>
[ Upstream commit 220fafb4ed04187e9c17be4152da5a7f2ffbdd8c ]

We should call of_node_put() for the reference returned by
of_get_child_by_name() which has increased the refcount.

Fixes: 30d2617fd7ed ("usb: gadget: aspeed: allow to set usb strings in device tree")
Signed-off-by: Liang He &lt;windhl@126.com&gt;
Link: https://lore.kernel.org/r/20220713120528.368168-1-windhl@126.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: udc: amd5536 depends on HAS_DMA</title>
<updated>2022-08-17T12:41:47Z</updated>
<author>
<name>Randy Dunlap</name>
</author>
<published>2022-07-09T01:36:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=87013f9270414c2d4f4a10264995e62675f07918'/>
<id>urn:sha1:87013f9270414c2d4f4a10264995e62675f07918</id>
<content type='text'>
[ Upstream commit 8097cf2fb3b2205257f1c76f4808e3398d66b6d9 ]

USB_AMD5536UDC should depend on HAS_DMA since it selects USB_SNP_CORE,
which depends on HAS_DMA and since 'select' does not follow any
dependency chains.

Fixes this kconfig warning:

WARNING: unmet direct dependencies detected for USB_SNP_CORE
  Depends on [n]: USB_SUPPORT [=y] &amp;&amp; USB_GADGET [=y] &amp;&amp; (USB_AMD5536UDC [=y] || USB_SNP_UDC_PLAT [=n]) &amp;&amp; HAS_DMA [=n]
  Selected by [y]:
  - USB_AMD5536UDC [=y] &amp;&amp; USB_SUPPORT [=y] &amp;&amp; USB_GADGET [=y] &amp;&amp; USB_PCI [=y]

Fixes: 97b3ffa233b9 ("usb: gadget: udc: amd5536: split core and PCI layer")
Cc: Raviteja Garimella &lt;raviteja.garimella@broadcom.com&gt;
Cc: Felipe Balbi &lt;balbi@kernel.org&gt;
Cc: linux-usb@vger.kernel.org
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Link: https://lore.kernel.org/r/20220709013601.7536-1-rdunlap@infradead.org
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_mass_storage: Make CD-ROM emulation works with Windows OS</title>
<updated>2022-08-17T12:41:39Z</updated>
<author>
<name>Neal Liu</name>
</author>
<published>2022-06-28T02:14:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=af4bf33ddb4d076cee868c8e53af139318f7b8ab'/>
<id>urn:sha1:af4bf33ddb4d076cee868c8e53af139318f7b8ab</id>
<content type='text'>
[ Upstream commit 3b91edd624ab1ab694deef513a45eb9e9d49d75f ]

Add read TOC with format 1 to support CD-ROM emulation with
Windows OS.
This patch is tested on Windows OS Server 2019.

Fixes: 89ada0fe669a ("usb: gadget: f_mass_storage: Make CD-ROM emulation work with Mac OS-X")
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Neal Liu &lt;neal_liu@aspeedtech.com&gt;
Link: https://lore.kernel.org/r/20220628021436.3252262-1-neal_liu@aspeedtech.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: tegra-xudc: Fix error check in tegra_xudc_powerdomain_init()</title>
<updated>2022-08-17T12:41:21Z</updated>
<author>
<name>Tang Bin</name>
</author>
<published>2022-05-25T13:53:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a61f248c24b024d0239db01306d6c9e1810e0790'/>
<id>urn:sha1:a61f248c24b024d0239db01306d6c9e1810e0790</id>
<content type='text'>
[ Upstream commit f08aa7c80dac27ee00fa6827f447597d2fba5465 ]

dev_pm_domain_attach_by_name() may return NULL in some cases,
so IS_ERR() doesn't meet the requirements. Thus fix it.

Fixes: 49db427232fe ("usb: gadget: Add UDC driver for tegra XUSB device mode controller")
Signed-off-by: Tang Bin &lt;tangbin@cmss.chinamobile.com&gt;
Link: https://lore.kernel.org/r/20220525135332.23144-1-tangbin@cmss.chinamobile.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: Fix double-free bug in raw_gadget driver</title>
<updated>2022-06-29T07:04:37Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2022-06-22T14:46:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c220cfdf594b17c08139bba34f7ef8680385b9e0'/>
<id>urn:sha1:c220cfdf594b17c08139bba34f7ef8680385b9e0</id>
<content type='text'>
commit 90bc2af24638659da56397ff835f3c95a948f991 upstream.

Re-reading a recently merged fix to the raw_gadget driver showed that
it inadvertently introduced a double-free bug in a failure pathway.
If raw_ioctl_init() encounters an error after the driver ID number has
been allocated, it deallocates the ID number before returning.  But
when dev_free() runs later on, it will then try to deallocate the ID
number a second time.

Closely related to this issue is another error in the recent fix: The
ID number is stored in the raw_dev structure before the code checks to
see whether the structure has already been initialized, in which case
the new ID number would overwrite the earlier value.

The solution to both bugs is to keep the new ID number in a local
variable, and store it in the raw_dev structure only after the check
for prior initialization.  No errors can occur after that point, so
the double-free will never happen.

Fixes: f2d8c2606825 ("usb: gadget: Fix non-unique driver names in raw-gadget driver")
CC: Andrey Konovalov &lt;andreyknvl@gmail.com&gt;
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/YrMrRw5AyIZghN0v@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: Fix non-unique driver names in raw-gadget driver</title>
<updated>2022-06-29T07:04:37Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2022-06-13T14:17:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e70cabfecee2da8042346205147845110be6e689'/>
<id>urn:sha1:e70cabfecee2da8042346205147845110be6e689</id>
<content type='text'>
commit f2d8c2606825317b77db1f9ba0fc26ef26160b30 upstream.

In a report for a separate bug (which has already been fixed by commit
5f0b5f4d50fa "usb: gadget: fix race when gadget driver register via
ioctl") in the raw-gadget driver, the syzbot console log included
error messages caused by attempted registration of a new driver with
the same name as an existing driver:

&gt; kobject_add_internal failed for raw-gadget with -EEXIST, don't try to register things with the same name in the same directory.
&gt; UDC core: USB Raw Gadget: driver registration failed: -17
&gt; misc raw-gadget: fail, usb_gadget_register_driver returned -17

These errors arise because raw_gadget.c registers a separate UDC
driver for each of the UDC instances it creates, but these drivers all
have the same name: "raw-gadget".  Until recently this wasn't a
problem, but when the "gadget" bus was added and UDC drivers were
registered on this bus, it became possible for name conflicts to cause
the registrations to fail.  The reason is simply that the bus code in
the driver core uses the driver name as a sysfs directory name (e.g.,
/sys/bus/gadget/drivers/raw-gadget/), and you can't create two
directories with the same pathname.

To fix this problem, the driver names used by raw-gadget are made
distinct by appending a unique ID number: "raw-gadget.N", with a
different value of N for each driver instance.  And to avoid the
proliferation of error handling code in the raw_ioctl_init() routine,
the error return paths are refactored into the common pattern (goto
statements leading to cleanup code at the end of the routine).

Link: https://lore.kernel.org/all/0000000000008c664105dffae2eb@google.com/
Fixes: fc274c1e9973 "USB: gadget: Add a new bus for gadgets"
CC: Andrey Konovalov &lt;andreyknvl@gmail.com&gt;
CC: &lt;stable@vger.kernel.org&gt;
Reported-and-tested-by: syzbot+02b16343704b3af1667e@syzkaller.appspotmail.com
Reviewed-by: Andrey Konovalov &lt;andreyknvl@gmail.com&gt;
Acked-by: Hillf Danton &lt;hdanton@sina.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/YqdG32w+3h8c1s7z@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: fix list double add in uvcg_video_pump</title>
<updated>2022-06-29T07:04:37Z</updated>
<author>
<name>Dan Vacura</name>
</author>
<published>2022-06-17T16:31:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d95ac8b920de1d39525fadc408ce675697626ca6'/>
<id>urn:sha1:d95ac8b920de1d39525fadc408ce675697626ca6</id>
<content type='text'>
commit 96163f835e65f8c9897487fac965819f0651d671 upstream.

A panic can occur if the endpoint becomes disabled and the
uvcg_video_pump adds the request back to the req_free list after it has
already been queued to the endpoint. The endpoint complete will add the
request back to the req_free list. Invalidate the local request handle
once it's been queued.

&lt;6&gt;[  246.796704][T13726] configfs-gadget gadget: uvc: uvc_function_set_alt(1, 0)
&lt;3&gt;[  246.797078][   T26] list_add double add: new=ffffff878bee5c40, prev=ffffff878bee5c40, next=ffffff878b0f0a90.
&lt;6&gt;[  246.797213][   T26] ------------[ cut here ]------------
&lt;2&gt;[  246.797224][   T26] kernel BUG at lib/list_debug.c:31!
&lt;6&gt;[  246.807073][   T26] Call trace:
&lt;6&gt;[  246.807180][   T26]  uvcg_video_pump+0x364/0x38c
&lt;6&gt;[  246.807366][   T26]  process_one_work+0x2a4/0x544
&lt;6&gt;[  246.807394][   T26]  worker_thread+0x350/0x784
&lt;6&gt;[  246.807442][   T26]  kthread+0x2ac/0x320

Fixes: f9897ec0f6d3 ("usb: gadget: uvc: only pump video data if necessary")
Cc: stable@vger.kernel.org
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Dan Vacura &lt;w36195@motorola.com&gt;
Link: https://lore.kernel.org/r/20220617163154.16621-1-w36195@motorola.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_fs: change ep-&gt;ep safe in ffs_epfile_io()</title>
<updated>2022-06-22T12:28:08Z</updated>
<author>
<name>Linyu Yuan</name>
</author>
<published>2022-06-10T12:17:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5eb643c4f3e58649208f45d11faffa744641b029'/>
<id>urn:sha1:5eb643c4f3e58649208f45d11faffa744641b029</id>
<content type='text'>
commit 0698f0209d8032e8869525aeb68f65ee7fde12ad upstream.

In ffs_epfile_io(), when read/write data in blocking mode, it will wait
the completion in interruptible mode, if task receive a signal, it will
terminate the wait, at same time, if function unbind occurs,
ffs_func_unbind() will kfree all eps, ffs_epfile_io() still try to
dequeue request by dereferencing ep which may become invalid.

Fix it by add ep spinlock and will not dereference ep if it is not valid.

Cc: &lt;stable@vger.kernel.org&gt; # 5.15
Reported-by: Michael Wu &lt;michael@allwinnertech.com&gt;
Tested-by: Michael Wu &lt;michael@allwinnertech.com&gt;
Reviewed-by: John Keeping &lt;john@metanate.com&gt;
Signed-off-by: Linyu Yuan &lt;quic_linyyuan@quicinc.com&gt;
Link: https://lore.kernel.org/r/1654863478-26228-3-git-send-email-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_fs: change ep-&gt;status safe in ffs_epfile_io()</title>
<updated>2022-06-22T12:28:08Z</updated>
<author>
<name>Linyu Yuan</name>
</author>
<published>2022-06-10T12:17:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7b7478d57be0d4043e39d3777ab808dd2a11b07c'/>
<id>urn:sha1:7b7478d57be0d4043e39d3777ab808dd2a11b07c</id>
<content type='text'>
commit fb1f16d74e263baa4ad11e31e28b68f144aa55ed upstream.

If a task read/write data in blocking mode, it will wait the completion
in ffs_epfile_io(), if function unbind occurs, ffs_func_unbind() will
kfree ffs ep, once the task wake up, it still dereference the ffs ep to
obtain the request status.

Fix it by moving the request status to io_data which is stack-safe.

Cc: &lt;stable@vger.kernel.org&gt; # 5.15
Reported-by: Michael Wu &lt;michael@allwinnertech.com&gt;
Tested-by: Michael Wu &lt;michael@allwinnertech.com&gt;
Reviewed-by: John Keeping &lt;john@metanate.com&gt;
Signed-off-by: Linyu Yuan &lt;quic_linyyuan@quicinc.com&gt;
Link: https://lore.kernel.org/r/1654863478-26228-2-git-send-email-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: lpc32xx_udc: Fix refcount leak in lpc32xx_udc_probe</title>
<updated>2022-06-22T12:28:07Z</updated>
<author>
<name>Miaoqian Lin</name>
</author>
<published>2022-06-03T14:02:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=727c82d003e0ec64411fd1257a9a57de4ad7a99a'/>
<id>urn:sha1:727c82d003e0ec64411fd1257a9a57de4ad7a99a</id>
<content type='text'>
commit 4757c9ade34178b351580133771f510b5ffcf9c8 upstream.

of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.
of_node_put() will check NULL pointer.

Fixes: 24a28e428351 ("USB: gadget driver for LPC32xx")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Miaoqian Lin &lt;linmq006@gmail.com&gt;
Link: https://lore.kernel.org/r/20220603140246.64529-1-linmq006@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
