mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
HID: roccat: savu: reject short special reports
The raw event callback runs before HID core validates and zero-pads the report. It passes the buffer to a helper which inspects data[0] and, for a special report, reads the complete struct savu_mouse_report_special. A truncated report can therefore cause an out-of-bounds read. Require enough data for the special report before calling the helper. Commit47669bec44("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw-event length validation to hid-asus. Fixes:6a2a6390cf("HID: roccat: add support for Roccat Savu") 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
02f3607d0b
commit
76c51fdc82
|
|
@ -182,6 +182,9 @@ static int savu_raw_event(struct hid_device *hdev,
|
|||
if (savu == NULL)
|
||||
return 0;
|
||||
|
||||
if (size < sizeof(struct savu_mouse_report_special))
|
||||
return 0;
|
||||
|
||||
if (savu->roccat_claimed)
|
||||
savu_report_to_chrdev(savu, data);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user