Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH 0/8] HID: validate report size in raw_event callbacks
@ 2026-10-18 21:37 Tristan Madani
  2026-10-18 21:37 ` [PATCH 1/8] HID: pxrc: validate report size in raw_event callback Tristan Madani
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Tristan Madani @ 2026-10-18 21:37 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: linux-input, Marcus Folkesson, Masaki Ota, Rahul Rameshbabu,
	Johannes Roith, Daniel M . Lambea, Derek J . Clark,
	Zhouwang Huang, David Barksdale, Don Prince, Clemens Ladisch,
	Tristan Madani

From: Tristan Madani <tristan@talencesecurity.com>

Several HID drivers access report data at fixed offsets in their
raw_event callbacks without checking that the buffer is large enough.

Since hid-core invokes each driver's raw_event callback before it
validates the report length in hid_report_raw_event(), these drivers
must perform their own bounds checking to handle short reports safely.

This series adds size validation to eight drivers:
 - pxrc, cougar, zydacron, mcp2200, prodikeys: simple minimum size
 - alps: per-report-type validation (touchpad, stick, absolute)
 - oxp: per-report-type struct size validation
 - cp2112: size checks for transfer status and data read responses,
   plus capping the read copy length to the available buffer

Tristan Madani (8):
  HID: pxrc: validate report size in raw_event callback
  HID: alps: validate report size in raw_event callbacks
  HID: mcp2200: validate report size in raw_event callback
  HID: cougar: validate report size in raw_event callback
  HID: zydacron: validate report size in raw_event callback
  HID: oxp: validate report size in raw_event callbacks
  HID: cp2112: validate report size in raw_event callback
  HID: prodikeys: validate report size in raw_event callback

 drivers/hid/hid-alps.c      | 12 ++++++++++++
 drivers/hid/hid-cougar.c    |  3 +++
 drivers/hid/hid-cp2112.c    | 10 ++++++++++
 drivers/hid/hid-mcp2200.c   |  3 +++
 drivers/hid/hid-oxp.c       |  6 ++++++
 drivers/hid/hid-prodikeys.c |  3 +++
 drivers/hid/hid-pxrc.c      |  3 +++
 drivers/hid/hid-zydacron.c  |  3 +++
 8 files changed, 43 insertions(+)

-- 
2.47.3


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

end of thread, other threads:[~2026-10-18 21:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-18 21:37 [PATCH 0/8] HID: validate report size in raw_event callbacks Tristan Madani
2026-10-18 21:37 ` [PATCH 1/8] HID: pxrc: validate report size in raw_event callback Tristan Madani
2026-10-18 21:37 ` [PATCH 2/8] HID: alps: validate report size in raw_event callbacks Tristan Madani
2026-10-18 21:45   ` sashiko-bot
2026-10-18 21:37 ` [PATCH 3/8] HID: mcp2200: validate report size in raw_event callback Tristan Madani
2026-10-18 21:37 ` [PATCH 4/8] HID: cougar: " Tristan Madani
2026-10-18 21:37 ` [PATCH 5/8] HID: zydacron: " Tristan Madani
2026-10-18 21:37 ` [PATCH 6/8] HID: oxp: validate report size in raw_event callbacks Tristan Madani
2026-10-18 21:48   ` sashiko-bot
2026-10-18 21:37 ` [PATCH 7/8] HID: cp2112: validate report size in raw_event callback Tristan Madani
2026-10-18 21:37 ` [PATCH 8/8] HID: prodikeys: " Tristan Madani
2026-10-18 21:44   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox