Input: synaptics-rmi4 - bound the F30 keymap to the GPIO/LED count
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3e64fcbdbd10e46dede502d507dbcc104837cd59 · < e849c6f51e6877104c765da084e001ec37c8e119| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Input: synaptics-rmi4 - bound the F30 keymap to the GPIO/LED count
rmi_f30_map_gpios() allocates gpioled_key_map with min(gpioled_count, TRACKSTICK_RANGE_END) == at most 6 entries, but rmi_f30_attention() iterates the full f30->gpioled_count (device query register, range 0..31) and dereferences gpioled_key_map[i], and input->keycodemax is set to the full gpioled_count while input->keycode points at the 6-entry allocation.
A device that reports gpioled_count > 6 with GPIO support enabled therefore causes an out-of-bounds read on the attention interrupt and out-of-bounds read/write through the EVIOCGKEYCODE/EVIOCSKEYCODE ioctls, which bound the index only against keycodemax. This is the same defect as the F3A handler, which was copied from F30.
Size the keymap for the full gpioled_count; the mapping loop still assigns only the first min(gpioled_count, TRACKSTICK_RANGE_END) entries.
From the CVE record · Linux
The synaptics-rmi4 F30 handler allocates a keymap for at most six entries but can access it using a larger device-reported GPIO/LED count. When a device reports more than six entries with GPIO support enabled, an attention interrupt can cause an out-of-bounds read, and keycode ioctls can cause out-of-bounds reads or writes. The input does not establish whether an attacker can control the device report or what access is needed to invoke the ioctls.
Engineers running the Linux kernel with synaptics-rmi4 F30 devices should check their systems; affected versions are not specified.