HID: playstation: Clamp num_touch_reports
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
HID: playstation: Clamp num_touch_reports
A device would never lie about the number of touch reports would it?
If it does the loop in dualshock4_parse_report will read off the end of the touch_reports array, up to about 2 KiB for the maximum number of 256 loop iteraions. The data that is read is emitted via evdev if the DS4_TOUCH_POINT_INACTIVE bit happens to be set. Protect against this by clamping the num_touch_reports value provided by the device to the maximum size of the touch_reports array.
From the CVE record · Linux
The Linux kernel’s PlayStation HID driver can read past the touch_reports array when a device reports too many touch reports. Data from the out-of-bounds read may be emitted through evdev if the DS4_TOUCH_POINT_INACTIVE bit is set; triggering this requires a device that supplies the excessive count.
Anyone running the Linux kernel with the PlayStation HID driver should check their kernel; affected versions are not specified.