mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
HID: roccat: ryos: reject short special reports
The raw event callback runs before HID core validates and zero-pads the report. It reads the report number without checking the received length and passes matching data to roccat_report_event(), which copies a complete struct ryos_report_special. A truncated report can therefore cause an out-of-bounds read and expose adjacent data through the Roccat character device. Require a complete special report before inspecting or forwarding it. Commit47669bec44("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw-event length validation to hid-asus. Fixes:6f3a193605("HID: roccat: add support for Ryos MK keyboards") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
This commit is contained in:
parent
493268f459
commit
02f3607d0b
|
|
@ -189,6 +189,9 @@ static int ryos_raw_event(struct hid_device *hdev,
|
|||
!= RYOS_USB_INTERFACE_PROTOCOL)
|
||||
return 0;
|
||||
|
||||
if (size < sizeof(struct ryos_report_special))
|
||||
return 0;
|
||||
|
||||
if (data[0] != RYOS_REPORT_NUMBER_SPECIAL)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user