mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
HID: roccat: isku: reject short button reports
The raw event callback runs before HID core validates and zero-pads the report. It passes the buffer to helpers which inspect data[0] and, for a button report, read the complete struct isku_report_button. A truncated report can therefore cause an out-of-bounds read. Require enough data for the button report before calling either helper. Commit47669bec44("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw-event length validation to hid-asus. Fixes:d41c2a7011("HID: roccat: Add support for Isku keyboard") 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
5e0f8396d4
commit
93e5f7f618
|
|
@ -411,6 +411,9 @@ static int isku_raw_event(struct hid_device *hdev,
|
|||
if (isku == NULL)
|
||||
return 0;
|
||||
|
||||
if (size < sizeof(struct isku_report_button))
|
||||
return 0;
|
||||
|
||||
isku_keep_values_up_to_date(isku, data);
|
||||
|
||||
if (isku->roccat_claimed)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user