<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/drivers/hid/usbhid, branch master</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master</id>
<link rel='self' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2026-08-03T18:27:41+00:00</updated>
<entry>
<title>HID: pidff: fix OOB write when hid-&gt;inputs is empty</title>
<updated>2026-08-03T18:27:41+00:00</updated>
<author>
<name>Baul Lee</name>
<email>baul.lee@xbow.com</email>
</author>
<published>2026-07-26T06:25:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=67bb1074e3d2d12fa059a9cc707e89398a4e4704'/>
<id>urn:sha1:67bb1074e3d2d12fa059a9cc707e89398a4e4704</id>
<content type='text'>
hid_pidff_init_with_quirks() derives its input_dev from

	list_entry(hid-&gt;inputs.next, struct hid_input, list)

without first checking that hid-&gt;inputs is non-empty.  The list member
of struct hid_input is at offset 0, so on an empty list list_entry()
yields &amp;hid-&gt;inputs itself and the following hidinput-&gt;input load reads
an unrelated member of struct hid_device.  dev is then a type-confused
pointer, and force-feedback init writes through it: each
set_bit(FF_*, dev-&gt;ffbit) stores 8 bytes at dev + 192, past the end of
the object dev actually aliases, and input_ff_create() adds further
writes of a heap pointer and two function pointers.

Until hid-universal-pidff the only caller was hid_pidff_init() from
usbhid, which runs under HID_CLAIMED_INPUT and therefore always has at
least one hid_input.  universal_pidff_probe() starts the device with
HID_CONNECT_DEFAULT &amp; ~HID_CONNECT_FF and then calls
hid_pidff_init_with_quirks() directly whenever the descriptor carries a
PID usage page, bypassing that gate.  A report descriptor whose only
application collection is on HID_UP_PID leaves hid-&gt;inputs empty while
hid_connect() still succeeds through the hidraw claim, so probe reaches
the unguarded list_entry().

The write happens in the USB probe path, on the hotplug workqueue, so
plugging in a malicious device is enough to trigger it; no attacker
software and no logged-in user are required.  KASAN reports an 8-byte
out-of-bounds write in hid_pidff_init_with_quirks() reached from
universal_pidff_probe().

Check for an empty list before deriving dev and return -ENODEV, as the
other HID force-feedback drivers already do.  universal_pidff_probe()
propagates the error and unwinds.

Discovered by XBOW, triaged by Baul Lee &lt;baul.lee@xbow.com&gt;

Fixes: f06bf8d94fff ("HID: Add hid-universal-pidff driver and supported device ids")
Reported-by: Federico Kirschbaum &lt;federico.kirschbaum@xbow.com&gt;
Reported-by: Baul Lee &lt;baul.lee@xbow.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Baul Lee &lt;baul.lee@xbow.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-7.2/core' into for-linus</title>
<updated>2026-06-16T19:57:57+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.com</email>
</author>
<published>2026-06-16T19:57:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b0e0c869271b957c47ae41c2b0a5e2a1779b0978'/>
<id>urn:sha1:b0e0c869271b957c47ae41c2b0a5e2a1779b0978</id>
<content type='text'>
</content>
</entry>
<entry>
<title>HID: pidff: Use correct effect type in effect update</title>
<updated>2026-06-10T16:00:28+00:00</updated>
<author>
<name>Oleg Makarenko</name>
<email>oleg@makarenk.ooo</email>
</author>
<published>2026-06-09T16:00:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b251598b8bf37300510868f739a79e07800d41ce'/>
<id>urn:sha1:b251598b8bf37300510868f739a79e07800d41ce</id>
<content type='text'>
When updating an existing effect, the effect type from the last created
effect was sent to the device instead of the updated one.
This caused incorrect reports when a game creates multiple different
effects and updates only one that is not the last created.

Fixes FFB in multiple games that create multiple simultaneous effects
(Forza Horizon 5/6).

Fixes: 224ee88fe395 ("Input: add force feedback driver for PID devices")
Cc: stable@vger.kernel.org
Tested-by: Oliver Roundtree &lt;oroundtree1@gmail.com&gt;
Co-developed-by: Ryno Kotzé &lt;lemon.xah@gmail.com&gt;
Signed-off-by: Ryno Kotzé &lt;lemon.xah@gmail.com&gt;
Signed-off-by: Oleg Makarenko &lt;oleg@makarenk.ooo&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>HID: pidff: Fix integer overflow in pidff_rescale</title>
<updated>2026-05-12T16:13:40+00:00</updated>
<author>
<name>Tomasz Pakuła</name>
<email>tomasz.pakula.oficjalny@gmail.com</email>
</author>
<published>2026-05-10T12:23:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=48d1677779ad6816978ad4a4f7588aec5ec960fe'/>
<id>urn:sha1:48d1677779ad6816978ad4a4f7588aec5ec960fe</id>
<content type='text'>
Rescaling values close to the max (U16_MAX) temporarily creates values
that exceed the s32 range. This caused value overflow in case when, for
example, a periodic effect phase was higer than 180 degrees. In turn,
rescale function could return values outised of the logical range of the
HID field.

Fix by using 64 bit signed integer to store the value during calculation
but still return only 32 bit integer.

Closes: https://github.com/JacKeTUs/universal-pidff/issues/116
Fixes: 224ee88fe395 ("Input: add force feedback driver for PID devices")
Cc: stable@vger.kernel.org
Signed-off-by: Tomasz Pakuła &lt;tomasz.pakula.oficjalny@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>HID: core: introduce hid_safe_input_report()</title>
<updated>2026-05-12T16:03:58+00:00</updated>
<author>
<name>Benjamin Tissoires</name>
<email>bentiss@kernel.org</email>
</author>
<published>2026-05-04T08:47:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=206342541fc887ae919774a43942dc883161fece'/>
<id>urn:sha1:206342541fc887ae919774a43942dc883161fece</id>
<content type='text'>
hid_input_report() is used in too many places to have a commit that
doesn't cross subsystem borders. Instead of changing the API, introduce
a new one when things matters in the transport layers:
- usbhid
- i2chid

This effectively revert to the old behavior for those two transport
layers.

Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>HID: usbhid: replace strlcat with better alternatives</title>
<updated>2026-05-12T15:33:07+00:00</updated>
<author>
<name>Mahad Ibrahim</name>
<email>mahad.ibrahim.dev@gmail.com</email>
</author>
<published>2026-04-10T19:24:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=34b228b739f5799f434f7de35328e482d385588b'/>
<id>urn:sha1:34b228b739f5799f434f7de35328e482d385588b</id>
<content type='text'>
In preparation for the removal of the strlcat() API as per the KSPP,
replace the string concatenation logic in hid-core, usbkbd, and
usbmouse with struct seq_buf, which tracks the current write position
and remaining space internally. The changes implemented include:

- Replace device name and phys concatenation with seq_buf_puts().
- Include Struct seq_buf and its initialization.
- Include header file of seq_buf.
- Replace strlen() with seq_buf_used() on the string buffer which was
  tracked by seq_buf to increase speed.
- Add size_t len in files which did not have it.
- Use of strscpy with length in place of strlcat.

Testing: This driver was compiled as a module as well as in-built in
QEMU with the QEMU basic mouse, and QEMU basic keyboard. The testing was
done in the following steps.
- Add Hardware Mouse in QEMU checking the usbhid module.
- Verify dmesg string name of mouse.
- Blacklist hidusb module from auto-loading, and removing the module via
  rmmod.
- Load usbmouse module, and reattach QEMU mouse.
- Verify dmesg string name of mouse.
- Repeat same procedure on usbkbd module.

This aligns the driver with KSPP security guidelines.

Link: https://github.com/KSPP/linux/issues/370

Signed-off-by: Mahad Ibrahim &lt;mahad.ibrahim.dev@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-7.1/pidff' into for-linus</title>
<updated>2026-04-16T19:05:37+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.com</email>
</author>
<published>2026-04-16T19:05:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=38d76018bb412dc66b08837097eff53d21e8df29'/>
<id>urn:sha1:38d76018bb412dc66b08837097eff53d21e8df29</id>
<content type='text'>
- various new per-device(-group) type quirks for pidff driver (Tomasz Pakuła)
</content>
</entry>
<entry>
<title>Merge branch 'for-7.1/core-v2' into for-linus</title>
<updated>2026-04-16T19:01:18+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.com</email>
</author>
<published>2026-04-16T19:01:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d4eb7b2da66c848709e31585b9c371fa234abc39'/>
<id>urn:sha1:d4eb7b2da66c848709e31585b9c371fa234abc39</id>
<content type='text'>
- fixed handling of 0-sized reports (Dmitry Torokhov)
- convert core code to __free() (Dmitry Torokhov)
- support for multiple batteries per HID device (Lucas Zampieri)
</content>
</entry>
<entry>
<title>HID: usbhid: refactor endpoint lookup</title>
<updated>2026-04-09T15:58:12+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2026-03-30T09:50:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2fcc5e0ee7989154c4a5d169bcc9565cf2d62147'/>
<id>urn:sha1:2fcc5e0ee7989154c4a5d169bcc9565cf2d62147</id>
<content type='text'>
Use the common USB helper for looking up interrupt-in endpoints instead
of open coding.

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>HID: usbhid: fix deadlock in hid_post_reset()</title>
<updated>2026-04-09T15:48:05+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2026-03-24T14:24:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8df2c1b47ee3cd50fd454f75c7a7e2ae8a6adf72'/>
<id>urn:sha1:8df2c1b47ee3cd50fd454f75c7a7e2ae8a6adf72</id>
<content type='text'>
You can build a USB device that includes a HID component
and a storage or UAS component. The components can be reset
only together. That means that hid_pre_reset() and hid_post_reset()
are in the block IO error handling. Hence no memory allocation
used in them may do block IO because the IO can deadlock
on the mutex held while resetting a device and calling the
interface drivers.
Use GFP_NOIO for all allocations in them.

Fixes: dc3c78e434690 ("HID: usbhid: Check HID report descriptor contents after device reset")
Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
</feed>
