gpiolib: Fix crash on error in gpiochip_get_ngpios()
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 crash on error in gpiochip_get_ngpios()
The gpiochip_get_ngpios() uses chip_*() macros to print messages. However these macros rely on gpiodev to be initialised and set, which is not the case when called via bgpio_init(). In such a case the printing messages will crash on NULL pointer dereference. Replace chip_*() macros by the respective dev_*() ones to avoid such crash.
From the CVE record · Linux
In the Linux kernel, gpiochip_get_ngpios() can dereference a NULL pointer while printing an error message when called through bgpio_init(). This can crash the kernel; the input does not specify an attacker path, authentication requirements, or user interaction.
Engineers running Linux kernels that use gpiolib should check their versions; affected versions are not specified.