]> git.hungrycats.org Git - linux/commit
HID: roccat: pyra: reject short button reports
authorJiale Yao <yaojiale02@163.com>
Thu, 24 Sep 2026 14:29:15 +0000 (22:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Nov 2026 17:10:51 +0000 (12:10 -0500)
commit1e190aef086106e76c0e01cf9d9bbc2f0f32db7f
tree74734526930188811262a2cdd9253fdd14aa71ad
parent1b19a4415e9baac8f5fad0577756621d5bb14487
HID: roccat: pyra: reject short button reports

commit 493268f459bb6aeeecbc77f2204c11ad74d05213 upstream.

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 read a
complete struct pyra_mouse_event_button for button reports.  A truncated
report can therefore cause an out-of-bounds read.

Require enough data for the button report before calling either helper.
Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init
sequence") added the same kind of raw-event length validation to hid-asus.

Fixes: cb7cf3da0daa ("HID: roccat: add driver for Roccat Pyra mouse")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-roccat-pyra.c