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

commit 02f3607d0beb82e76481568bf631235e6a319b47 upstream.

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.
Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init
sequence") added the same kind of raw-event length validation to hid-asus.

Fixes: 6f3a19360545 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-roccat-ryos.c