<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/class/usblp.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-01-17T12:40:54+00:00</updated>
<entry>
<title>USB: usblp: return error when setting unsupported protocol</title>
<updated>2025-01-17T12:40:54+00:00</updated>
<author>
<name>Jun Yan</name>
<email>jerrysteve1101@gmail.com</email>
</author>
<published>2024-12-12T14:38:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=61e0a97342e7fa0876bfdfefc1f316005fed26ae'/>
<id>urn:sha1:61e0a97342e7fa0876bfdfefc1f316005fed26ae</id>
<content type='text'>
commit 7a3d76a0b60b3f6fc3375e4de2174bab43f64545 upstream.

Fix the regression introduced by commit d8c6edfa3f4e ("USB:
usblp: don't call usb_set_interface if there's a single alt"),
which causes that unsupported protocols can also be set via
ioctl when the num_altsetting of the device is 1.

Move the check for protocol support to the earlier stage.

Fixes: d8c6edfa3f4e ("USB: usblp: don't call usb_set_interface if there's a single alt")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Jun Yan &lt;jerrysteve1101@gmail.com&gt;
Link: https://lore.kernel.org/r/20241212143852.671889-1-jerrysteve1101@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: make devnode() callback in usb_class_driver take a const *</title>
<updated>2022-10-20T10:11:56+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2022-10-01T16:51:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5033ac5c580cb22245a0c2b9e53d508e8fdd50d8'/>
<id>urn:sha1:5033ac5c580cb22245a0c2b9e53d508e8fdd50d8</id>
<content type='text'>
With the changes to the driver core to make more pointers const, the USB
subsystem also needs to be modified to take a const * for the devnode
callback so that the driver core's constant pointer will also be
properly propagated.

Cc: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Cc: Juergen Stuber &lt;starblue@users.sourceforge.net&gt;
Reviewed-by: Johan Hovold &lt;johan@kernel.org&gt;
Acked-by: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Reviewed-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Link: https://lore.kernel.org/r/20221001165128.2688526-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: usblp: fix a hang in poll() if disconnected</title>
<updated>2021-03-10T08:36:13+00:00</updated>
<author>
<name>Pete Zaitcev</name>
<email>zaitcev@redhat.com</email>
</author>
<published>2021-03-04T04:10:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9de2c43acf37a17dc4c69ff78bb099b80fb74325'/>
<id>urn:sha1:9de2c43acf37a17dc4c69ff78bb099b80fb74325</id>
<content type='text'>
Apparently an application that opens a device and calls select()
on it, will hang if the decice is disconnected. It's a little
surprising that we had this bug for 15 years, but apparently
nobody ever uses select() with a printer: only write() and read(),
and those work fine. Well, you can also select() with a timeout.

The fix is modeled after devio.c. A few other drivers check the
condition first, then do not add the wait queue in case the
device is disconnected. We doubt that's completely race-free.
So, this patch adds the process first, then locks properly
and checks for the disconnect.

Reviewed-by: Zqiang &lt;qiang.zhang@windriver.com&gt;
Signed-off-by: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20210303221053.1cf3313e@suzdal.zaitcev.lan
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: usblp: don't call usb_set_interface if there's a single alt</title>
<updated>2021-01-26T14:15:31+00:00</updated>
<author>
<name>Jeremy Figgins</name>
<email>kernel@jeremyfiggins.com</email>
</author>
<published>2021-01-24T00:21:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d8c6edfa3f4ee0d45d7ce5ef18d1245b78774b9d'/>
<id>urn:sha1:d8c6edfa3f4ee0d45d7ce5ef18d1245b78774b9d</id>
<content type='text'>
Some devices, such as the Winbond Electronics Corp. Virtual Com Port
(Vendor=0416, ProdId=5011), lockup when usb_set_interface() or
usb_clear_halt() are called. This device has only a single
altsetting, so it should not be necessary to call usb_set_interface().

Acked-by: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Signed-off-by: Jeremy Figgins &lt;kernel@jeremyfiggins.com&gt;
Link: https://lore.kernel.org/r/YAy9kJhM/rG8EQXC@watson
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: usblp: fix DMA to stack</title>
<updated>2021-01-04T15:51:35+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2021-01-04T14:53:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=020a1f453449294926ca548d8d5ca970926e8dfd'/>
<id>urn:sha1:020a1f453449294926ca548d8d5ca970926e8dfd</id>
<content type='text'>
Stack-allocated buffers cannot be used for DMA (on all architectures).

Replace the HP-channel macro with a helper function that allocates a
dedicated transfer buffer so that it can continue to be used with
arguments from the stack.

Note that the buffer is cleared on allocation as usblp_ctrl_msg()
returns success also on short transfers (the buffer is only used for
debugging).

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Link: https://lore.kernel.org/r/20210104145302.2087-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usblp: fix race between disconnect() and read()</title>
<updated>2020-09-17T16:45:30+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2020-09-17T10:34:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9cdabcb3ef8c24ca3a456e4db7b012befb688e73'/>
<id>urn:sha1:9cdabcb3ef8c24ca3a456e4db7b012befb688e73</id>
<content type='text'>
read() needs to check whether the device has been
disconnected before it tries to talk to the device.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Reported-by: syzbot+be5b5f86a162a6c281e6@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20200917103427.15740-1-oneukum@suse.com
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usblp: poison URBs upon disconnect</title>
<updated>2020-05-13T12:20:00+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2020-05-07T08:58:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=296a193b06120aa6ae7cf5c0d7b5e5b55968026e'/>
<id>urn:sha1:296a193b06120aa6ae7cf5c0d7b5e5b55968026e</id>
<content type='text'>
syzkaller reported an URB that should have been killed to be active.
We do not understand it, but this should fix the issue if it is real.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Reported-by: syzbot+be5b5f86a162a6c281e6@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20200507085806.5793-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: usblp: fix use-after-free on disconnect</title>
<updated>2019-10-15T18:19:19+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2019-10-15T17:55:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7a759197974894213621aa65f0571b51904733d6'/>
<id>urn:sha1:7a759197974894213621aa65f0571b51904733d6</id>
<content type='text'>
A recent commit addressing a runtime PM use-count regression, introduced
a use-after-free by not making sure we held a reference to the struct
usb_interface for the lifetime of the driver data.

Fixes: 9a31535859bf ("USB: usblp: fix runtime PM after driver unbind")
Cc: stable &lt;stable@vger.kernel.org&gt;
Reported-by: syzbot+cd24df4d075c319ebfc5@syzkaller.appspotmail.com
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Link: https://lore.kernel.org/r/20191015175522.18490-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: usblp: fix runtime PM after driver unbind</title>
<updated>2019-10-04T12:38:45+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2019-10-01T08:49:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9a31535859bfd8d1c3ed391f5e9247cd87bb7909'/>
<id>urn:sha1:9a31535859bfd8d1c3ed391f5e9247cd87bb7909</id>
<content type='text'>
Since commit c2b71462d294 ("USB: core: Fix bug caused by duplicate
interface PM usage counter") USB drivers must always balance their
runtime PM gets and puts, including when the driver has already been
unbound from the interface.

Leaving the interface with a positive PM usage counter would prevent a
later bound driver from suspending the device.

Fixes: c2b71462d294 ("USB: core: Fix bug caused by duplicate interface PM usage counter")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Link: https://lore.kernel.org/r/20191001084908.2003-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: usblp: convert to use dev_groups</title>
<updated>2019-08-09T05:55:44+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-08-06T14:44:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=02c4d45d838957971ec5b7ee359380a0ccfdb963'/>
<id>urn:sha1:02c4d45d838957971ec5b7ee359380a0ccfdb963</id>
<content type='text'>
USB drivers now support the ability for the driver core to handle the
creation and removal of device-specific sysfs files in a race-free
manner.  Take advantage of that by converting the driver to use this by
moving the sysfs attributes into a group and assigning the dev_groups
pointer to it.

Cc: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Link: https://lore.kernel.org/r/20190806144502.17792-6-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
