CVE-2025-38395
JSON

8.4high

regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods

Severity
8.4high CVSS:3.1 by Linux
Exploit likelihood
0.21% (higher than 12% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods drvdata::gpiods is supposed to hold an array of 'gpio_desc' pointers. But the memory is allocated for only one pointer. This will lead to out-of-bounds access later in the code if 'config::ngpios' is > 1. So fix the code to allocate enough memory to hold 'config::ngpios' of GPIO descriptors. While at it, also move the check for memory allocation failure to be below the allocation to make it more readable.

Affected

Product or packageVersionsReported by
Linux Linuxfrom d6cd33ad71029a3f77ba1686caf55d4dea58d916 before a3cd5ae7befbac849e0e0529c94ca04e8093cfd2, from d6cd33ad71029a3f77ba1686caf55d4dea58d916 before 9fe71972869faed1f8f9b3beb9040f9c1b300c79, from d6cd33ad71029a3f77ba1686caf55d4dea58d916 before 56738cbac3bbb1d39a71a07f57484dec1db8b239, from d6cd33ad71029a3f77ba1686caf55d4dea58d916 before a1e12fac214d4f49fcb186dbdf9c5592e7fa0a7a, from d6cd33ad71029a3f77ba1686caf55d4dea58d916 before 24418bc77a66cb5be9f5a837431ba3674ed8b52f, from d6cd33ad71029a3f77ba1686caf55d4dea58d916 before e4d19e5d71b217940e33f2ef6c6962b7b68c5606, from d6cd33ad71029a3f77ba1686caf55d4dea58d916 before 3830ab97cda9599872625cc0dc7b00160193634f, from d6cd33ad71029a3f77ba1686caf55d4dea58d916 before c9764fd88bc744592b0604ccb6b6fc1a5f76b4e3 and 1 more
Not affected: before 5.1, from 5.4.296 up to 5.4.*, from 5.10.240 up to 5.10.*, from 5.15.187 up to 5.15.*, from 6.1.144 up to 6.1.*, from 6.6.97 up to 6.6.*
CVE List
linux linux_kernelfrom 5.1 before 5.4.296, from 5.5 before 5.10.240, from 5.11 before 5.15.187, from 5.16 before 6.1.144, from 6.2 before 6.6.97, from 6.7 before 6.12.37, from 6.13 before 6.15.6, 6.16NVD
debian debian_linux11.0NVD

All scores

Linux8.4high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD7.1high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H

Classification

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods drvdata::gpiods is supposed to hold an array of 'gpio_desc' pointers. But the memory is allocated for only one pointer. This will lead to out-of-bounds access later in the code if 'config::ngpios' is > 1. So fix the code to allocate enough memory to hold 'config::ngpios' of GPIO descriptors. While at it, also move the check for memory allocation failure to be below the allocation to make it more readable.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: regulator: gpio: Se corrige el acceso fuera de los límites a drvdata::gpiods. drvdata::gpiods debe contener una matriz de punteros 'gpio_desc'. Sin embargo, la memoria solo está asignada a un puntero. Esto provocará un acceso fuera de los límites más adelante en el código si 'config::ngpios' es > 1. Por lo tanto, corrija el código para asignar suficiente memoria para contener 'config::ngpios' de descriptores GPIO. Además, mueva la comprobación de fallos de asignación de memoria a un valor inferior a la asignación para que sea más legible.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-38395 changed 2026-08-05CVE Terms of Use
NVDCVE-2025-38395 changed 2026-07-30Public domain