<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/hid/usbhid, branch v5.15.208</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.208</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.208'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-02-06T15:41:47+00:00</updated>
<entry>
<title>HID: usbhid: paper over wrong bNumDescriptor field</title>
<updated>2026-02-06T15:41:47+00:00</updated>
<author>
<name>Benjamin Tissoires</name>
<email>bentiss@kernel.org</email>
</author>
<published>2025-12-15T11:57:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7d76380e98bfa6914e0787cc361d54d5fae8b650'/>
<id>urn:sha1:7d76380e98bfa6914e0787cc361d54d5fae8b650</id>
<content type='text'>
commit f28beb69c51517aec7067dfb2074e7c751542384 upstream.

Some faulty devices (ZWO EFWmini) have a wrong optional HID class
descriptor count compared to the provided length.

Given that we plainly ignore those optional descriptor, we can attempt
to fix the provided number so we do not lock out those devices.

Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
Cc: Salvatore Bonaccorso &lt;carnil@debian.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>HID: usbhid: Eliminate recurrent out-of-bounds bug in usbhid_parse()</title>
<updated>2025-06-27T10:05:34+00:00</updated>
<author>
<name>Terry Junge</name>
<email>linuxhid@cosmicgizmosystems.com</email>
</author>
<published>2025-03-12T22:23:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1df80d748f984290c895e843401824215dcfbfb0'/>
<id>urn:sha1:1df80d748f984290c895e843401824215dcfbfb0</id>
<content type='text'>
commit fe7f7ac8e0c708446ff017453add769ffc15deed upstream.

Update struct hid_descriptor to better reflect the mandatory and
optional parts of the HID Descriptor as per USB HID 1.11 specification.
Note: the kernel currently does not parse any optional HID class
descriptors, only the mandatory report descriptor.

Update all references to member element desc[0] to rpt_desc.

Add test to verify bLength and bNumDescriptors values are valid.

Replace the for loop with direct access to the mandatory HID class
descriptor member for the report descriptor. This eliminates the
possibility of getting an out-of-bounds fault.

Add a warning message if the HID descriptor contains any unsupported
optional HID class descriptors.

Reported-by: syzbot+c52569baf0c843f35495@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c52569baf0c843f35495
Fixes: f043bfc98c19 ("HID: usbhid: fix out-of-bounds bug")
Cc: stable@vger.kernel.org
Signed-off-by: Terry Junge &lt;linuxhid@cosmicgizmosystems.com&gt;
Reviewed-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Terry Junge &lt;linuxhid@cosmicgizmosystems.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>HID: usbkbd: Fix the bit shift number for LED_KANA</title>
<updated>2025-06-04T12:38:04+00:00</updated>
<author>
<name>junan</name>
<email>junan76@163.com</email>
</author>
<published>2024-11-28T02:35:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d6fd1eee07675f293b2a40239ca2ec47c8798227'/>
<id>urn:sha1:d6fd1eee07675f293b2a40239ca2ec47c8798227</id>
<content type='text'>
[ Upstream commit d73a4bfa2881a6859b384b75a414c33d4898b055 ]

Since "LED_KANA" was defined as "0x04", the shift number should be "4".

Signed-off-by: junan &lt;junan76@163.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>HID: pidff: Fix null pointer dereference in pidff_find_fields</title>
<updated>2025-05-02T05:43:54+00:00</updated>
<author>
<name>Tomasz Pakuła</name>
<email>forest10pl@gmail.com</email>
</author>
<published>2025-02-01T11:39:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6b4449e4f03326fbd2136e67bfcc1e6ffe61541d'/>
<id>urn:sha1:6b4449e4f03326fbd2136e67bfcc1e6ffe61541d</id>
<content type='text'>
[ Upstream commit 22a05462c3d0eee15154faf8d13c49e6295270a5 ]

This function triggered a null pointer dereference if used to search for
a report that isn't implemented on the device. This happened both for
optional and required reports alike.

The same logic was applied to pidff_find_special_field and although
pidff_init_fields should return an error earlier if one of the required
reports is missing, future modifications could change this logic and
resurface this possible null pointer dereference again.

LKML bug report:
https://lore.kernel.org/all/CAL-gK7f5=R0nrrQdPtaZZr1fd-cdAMbDMuZ_NLA8vM0SX+nGSw@mail.gmail.com

Reported-by: Nolan Nicholson &lt;nolananicholson@gmail.com&gt;
Signed-off-by: Tomasz Pakuła &lt;tomasz.pakula.oficjalny@gmail.com&gt;
Reviewed-by: Michał Kopeć &lt;michal@nozomi.space&gt;
Reviewed-by: Paul Dino Jones &lt;paul@spacefreak18.xyz&gt;
Tested-by: Paul Dino Jones &lt;paul@spacefreak18.xyz&gt;
Tested-by: Cristóferson Bueno &lt;cbueno81@gmail.com&gt;
Tested-by: Pablo Cisneros &lt;patchkez@protonmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>HID: pidff: Do not send effect envelope if it's empty</title>
<updated>2025-05-02T05:43:54+00:00</updated>
<author>
<name>Tomasz Pakuła</name>
<email>tomasz.pakula.oficjalny@gmail.com</email>
</author>
<published>2025-02-01T11:38:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4c5f8e5946570c250b97a84185234e9f82a9c650'/>
<id>urn:sha1:4c5f8e5946570c250b97a84185234e9f82a9c650</id>
<content type='text'>
[ Upstream commit 8876fc1884f5b39550c8387ff3176396c988541d ]

Envelope struct is always initialized, but the envelope itself is
optional as described in USB PID Device class definition 1.0.

5.1.1.1 Type Specific Block Offsets
...
4) Effects that do not use Condition Blocks use 1 Parameter Block and
an *optional* Envelope Block.

Sending out "empty" envelope breaks force feedback on some devices with
games that use SINE effect + offset to emulate constant force effect, as
well as generally breaking Constant/Periodic effects. One of the affected
brands is Moza Racing.

This change prevents the envelope from being sent if it contains all
0 values while keeping the old behavior of only sending it, if it differs
from the old one.

Changes in v6:
- Simplify the checks to make them clearer
- Fix possible null pointer dereference while calling
  pidff_needs_set_envelope

Signed-off-by: Tomasz Pakuła &lt;tomasz.pakula.oficjalny@gmail.com&gt;
Reviewed-by: Michał Kopeć &lt;michal@nozomi.space&gt;
Reviewed-by: Paul Dino Jones &lt;paul@spacefreak18.xyz&gt;
Tested-by: Paul Dino Jones &lt;paul@spacefreak18.xyz&gt;
Tested-by: Cristóferson Bueno &lt;cbueno81@gmail.com&gt;
Tested-by: Pablo Cisneros &lt;patchkez@protonmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>HID: pidff: Convert infinite length from Linux API to PID standard</title>
<updated>2025-05-02T05:43:53+00:00</updated>
<author>
<name>Tomasz Pakuła</name>
<email>tomasz.pakula.oficjalny@gmail.com</email>
</author>
<published>2025-02-01T11:38:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b5d9c541ad336884ade1e23878b61dde3e632c3c'/>
<id>urn:sha1:b5d9c541ad336884ade1e23878b61dde3e632c3c</id>
<content type='text'>
[ Upstream commit 37e0591fe44dce39d1ebc7a82d5b6e4dba1582eb ]

Software uses 0 as de-facto infinite lenght on Linux FF apis (SDL),
Linux doesn't actually define anythi as of now, while USB PID defines
NULL (0xffff). Most PID devices do not expect a 0-length effect and
can't interpret it as infinite. This change fixes Force Feedback for
most PID compliant devices.

As most games depend on updating the values of already playing infinite
effects, this is crucial to ensure they will actually work.

Previously, users had to rely on third-party software to do this conversion
and make their PID devices usable.

Co-developed-by: Makarenko Oleg &lt;oleg@makarenk.ooo&gt;
Signed-off-by: Makarenko Oleg &lt;oleg@makarenk.ooo&gt;
Signed-off-by: Tomasz Pakuła &lt;tomasz.pakula.oficjalny@gmail.com&gt;
Reviewed-by: Michał Kopeć &lt;michal@nozomi.space&gt;
Reviewed-by: Paul Dino Jones &lt;paul@spacefreak18.xyz&gt;
Tested-by: Paul Dino Jones &lt;paul@spacefreak18.xyz&gt;
Tested-by: Cristóferson Bueno &lt;cbueno81@gmail.com&gt;
Tested-by: Pablo Cisneros &lt;patchkez@protonmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-5.15/core' into for-linus</title>
<updated>2021-09-01T20:00:06+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2021-09-01T20:00:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dab6e4f452c2fd45c15c701e6f7be665a72c7add'/>
<id>urn:sha1:dab6e4f452c2fd45c15c701e6f7be665a72c7add</id>
<content type='text'>
- Regression fix for an issue in HID core that got uncovered by recent USB core
  cleanup leading to issues when transfer_buffer_length is not in line with wLength
- Memory leak fix in USB HID core
- Improvement of stylus battery reporting
</content>
</entry>
<entry>
<title>HID: usbhid: Simplify code in hid_submit_ctrl()</title>
<updated>2021-09-01T18:52:32+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2021-09-01T16:36:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d2f311ec91984adb219ac6985d4dd72c37ae734d'/>
<id>urn:sha1:d2f311ec91984adb219ac6985d4dd72c37ae734d</id>
<content type='text'>
This patch makes a small simplification to the code in
hid_submit_ctrl().  The test for maxpacket being &gt; 0 is unnecessary,
because endpoint 0 always has a maxpacket value which is &gt;= 8.

Furthermore, endpoint 0's maxpacket value is always a power of 2, so
instead of open-coding the round-to-next-multiple computation we can
call the optimized round_up() routine.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Tested-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Acked-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: usbhid: Fix warning caused by 0-length input reports</title>
<updated>2021-09-01T18:52:31+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2021-09-01T16:36:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0a824efdb724e07574bafcd2c2486b2a3de35ff6'/>
<id>urn:sha1:0a824efdb724e07574bafcd2c2486b2a3de35ff6</id>
<content type='text'>
Syzbot found a warning caused by hid_submit_ctrl() submitting a
control request to transfer a 0-length input report:

	usb 1-1: BOGUS control dir, pipe 80000280 doesn't match bRequestType a1

(The warning message is a little difficult to understand.  It means
that the control request claims to be for an IN transfer but this
contradicts the USB spec, which requires 0-length control transfers
always to be in the OUT direction.)

Now, a zero-length report isn't good for anything and there's no
reason for a device to have one, but the fuzzer likes to pick out
these weird edge cases.  In the future, perhaps we will decide to
reject 0-length reports at probe time.  For now, the simplest approach
for avoiding these warnings is to pretend that the report actually has
length 1.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-and-tested-by: syzbot+9b57a46bf1801ce2a2ca@syzkaller.appspotmail.com
Tested-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Tested-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Acked-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: usbhid: Fix flood of "control queue full" messages</title>
<updated>2021-09-01T18:52:31+00:00</updated>
<author>
<name>Michal Kubecek</name>
<email>mkubecek@suse.cz</email>
</author>
<published>2021-09-01T16:35:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5049307d37a760e304ad191c5dc7c6851266d2f8'/>
<id>urn:sha1:5049307d37a760e304ad191c5dc7c6851266d2f8</id>
<content type='text'>
[patch description by Alan Stern]

Commit 7652dd2c5cb7 ("USB: core: Check buffer length matches wLength
for control transfers") causes control URB submissions to fail if the
transfer_buffer_length value disagrees with the setup packet's wLength
valuel.  Unfortunately, it turns out that the usbhid can trigger this
failure mode when it submits a control request for an input report: It
pads the transfer buffer size to a multiple of the maxpacket value but
does not increase wLength correspondingly.

These failures have caused problems for people using an APS UPC, in
the form of a flood of log messages resembling:

	hid-generic 0003:051D:0002.0002: control queue full

This patch fixes the problem by setting the wLength value equal to the
padded transfer_buffer_length value in hid_submit_ctrl().  As a nice
bonus, the code which stores the transfer_buffer_length value is now
shared between the two branches of an "if" statement, so it can be
de-duplicated.

Signed-off-by: Michal Kubecek &lt;mkubecek@suse.cz&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Fixes: 7652dd2c5cb7 ("USB: core: Check buffer length matches wLength for control transfers")
Tested-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Tested-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Acked-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
