]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
HID: playstation: validate num_touch_reports in DualShock 4 reports
authorBenoît Sevens <bsevens@google.com>
Mon, 23 Mar 2026 12:47:37 +0000 (12:47 +0000)
committerJiri Kosina <jkosina@suse.com>
Thu, 9 Apr 2026 15:54:42 +0000 (17:54 +0200)
commit82a4fc46330910b4c1d9b189561439d468e3ff11
tree034a8d971d6c524cb7a49c000a95498b81d26ec6
parent8df2c1b47ee3cd50fd454f75c7a7e2ae8a6adf72
HID: playstation: validate num_touch_reports in DualShock 4 reports

The DualShock 4 HID driver fails to validate the num_touch_reports field
received from the device in both USB and Bluetooth input reports.
A malicious device could set this field to a value larger than the
allocated size of the touch_reports array (3 for USB, 4 for Bluetooth),
leading to an out-of-bounds read in dualshock4_parse_report().

This can result in kernel memory disclosure when processing malicious
HID reports.

Validate num_touch_reports against the array size for the respective
connection types before processing the touch data.

Signed-off-by: Benoît Sevens <bsevens@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-playstation.c