gpio: prevent potential speculation leaks in gpio_device_get_desc()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 521a2ad6f862a28e2e43cb3e254a26bf0f9452e9 · < 1b955f786a4bcde8c0ccb2b7d519def2acb6f3cc| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
gpio: prevent potential speculation leaks in gpio_device_get_desc()
Userspace may trigger a speculative read of an address outside the gpio descriptor array. Users can do that by calling gpio_ioctl() with an offset out of range. Offset is copied from user and then used as an array index to get the gpio descriptor without sanitization in gpio_device_get_desc().
This change ensures that the offset is sanitized by using array_index_nospec() to mitigate any possibility of speculative information leaks.
This bug was discovered and resolved using Coverity Static Analysis Security Testing (SAST) by Synopsys, Inc.
From the CVE record · Linux
The Linux kernel’s gpio_device_get_desc() does not sanitize an offset before using it to index the GPIO descriptor array. A local userspace caller can pass an out-of-range offset to gpio_ioctl(), potentially causing a speculative out-of-bounds read and information leak.
Engineers running Linux kernels should check whether their kernel includes the fix; affected versions were not specified.