mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
HID: roccat: konepure: reject short button 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 konepure_mouse_report_button. A truncated report can therefore cause an out-of-bounds read and expose adjacent data through the Roccat character device. Require a complete button 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:8936aa31cd("HID: roccat: add support for Roccat Kone Pure gaming mouse") 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
d879e17a8b
commit
1590b7c9be
|
|
@ -181,6 +181,9 @@ static int konepure_raw_event(struct hid_device *hdev,
|
|||
!= USB_INTERFACE_PROTOCOL_MOUSE)
|
||||
return 0;
|
||||
|
||||
if (size < sizeof(struct konepure_mouse_report_button))
|
||||
return 0;
|
||||
|
||||
if (data[0] != KONEPURE_MOUSE_REPORT_NUMBER_BUTTON)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user