linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] HID: core: fix __hid_request when no report ID is used
@ 2025-07-10 14:01 Benjamin Tissoires
  2025-07-10 14:01 ` [PATCH v2 1/4] HID: core: ensure the allocated report buffer can contain the reserved report ID Benjamin Tissoires
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Benjamin Tissoires @ 2025-07-10 14:01 UTC (permalink / raw)
  To: Jiri Kosina, Alan Stern, Shuah Khan
  Cc: linux-input, linux-kernel, linux-kselftest, Benjamin Tissoires,
	stable, syzbot+8258d5439c49d4c35f43

New version (unchanged for patches 1-3), with a test added so we can
detect this.

Followup of https://lore.kernel.org/linux-input/c75433e0-9b47-4072-bbe8-b1d14ea97b13@rowland.harvard.edu/

This initial series attempt at fixing the various bugs discovered by
Alan regarding __hid_request().

Syzbot managed to create a report descriptor which presents a feature
request of size 0 (still trying to extract it) and this exposed the fact
that __hid_request() was incorrectly handling the case when the report
ID is not used.

Send a first batch of fixes now so we get the feedback from syzbot ASAP.

Note: in the series, I also mentioned that the report of size 0 should
be stripped out of the HID device, but I'm not entirely sure this would
be a good idea in the end.

Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
---
Changes in v2:
- added Tested-by from syzbot (https://lore.kernel.org/r/686e9113.050a0220.385921.0008.GAE@google.com)
- added a python test for it
- Link to v1: https://lore.kernel.org/r/20250709-report-size-null-v1-0-194912215cbc@kernel.org

---
Benjamin Tissoires (4):
      HID: core: ensure the allocated report buffer can contain the reserved report ID
      HID: core: ensure __hid_request reserves the report ID as the first byte
      HID: core: do not bypass hid_hw_raw_request
      selftests/hid: add a test case for the recent syzbot underflow

 drivers/hid/hid-core.c                          | 19 +++++--
 tools/testing/selftests/hid/tests/test_mouse.py | 70 +++++++++++++++++++++++++
 2 files changed, 84 insertions(+), 5 deletions(-)
---
base-commit: 1f988d0788f50d8464f957e793fab356e2937369
change-id: 20250709-report-size-null-37619ea20288

Best regards,
-- 
Benjamin Tissoires <bentiss@kernel.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-07-13  7:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-10 14:01 [PATCH v2 0/4] HID: core: fix __hid_request when no report ID is used Benjamin Tissoires
2025-07-10 14:01 ` [PATCH v2 1/4] HID: core: ensure the allocated report buffer can contain the reserved report ID Benjamin Tissoires
2025-07-10 14:01 ` [PATCH v2 2/4] HID: core: ensure __hid_request reserves the report ID as the first byte Benjamin Tissoires
2025-07-10 14:01 ` [PATCH v2 3/4] HID: core: do not bypass hid_hw_raw_request Benjamin Tissoires
2025-07-10 14:01 ` [PATCH v2 4/4] selftests/hid: add a test case for the recent syzbot underflow Benjamin Tissoires
2025-07-11 10:52   ` Benjamin Tissoires
2025-07-13  7:44     ` Benjamin Tissoires
2025-07-13  7:54 ` [PATCH v2 0/4] HID: core: fix __hid_request when no report ID is used Benjamin Tissoires

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).