Linux kernel memory leak in GPIO array value error handling
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths
A drive-by review by Sashiko reports that, after a failed call to gpiochip_set_multiple(), gpiod_set_array_value() returns abruptly, bypassing the freeing of possibly alloced bitmaps, potentially leaking memory. It is an unlikely error path, but is possible.
Defer the return code check until after the bitmap_free() block.
From the CVE record · Linux
The Linux kernel can leak allocated bitmaps when gpiochip_set_multiple() fails in gpiod_set_array_value_complex(). This is an unlikely error path; the input does not describe an attacker route or specify network access, authentication, or user interaction requirements.
Engineers running the Linux kernel should check their deployments; affected versions are not specified.