# CVE-2025-38395: regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods

- Severity: High 8.4 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 12% of CVEs (2026-12-01)
- Published: 2025-07-25T12:53:39.933Z
- Modified: 2026-08-05T12:01:33.139Z
- Weaknesses: CWE-125
- 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 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; 5.1 (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.*; from 6.12.37 up to 6.12.*; from 6.15.6 up to 6.15.*; from 6.16 up to *)
- linux linux_kernel: from 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.16
- debian debian_linux: 11.0

## Every score

- Linux: CVSS:3.1 8.4 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.1 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/a3cd5ae7befbac849e0e0529c94ca04e8093cfd2> (patch)
- <https://git.kernel.org/stable/c/9fe71972869faed1f8f9b3beb9040f9c1b300c79> (patch)
- <https://git.kernel.org/stable/c/56738cbac3bbb1d39a71a07f57484dec1db8b239> (patch)
- <https://git.kernel.org/stable/c/a1e12fac214d4f49fcb186dbdf9c5592e7fa0a7a> (patch)
- <https://git.kernel.org/stable/c/24418bc77a66cb5be9f5a837431ba3674ed8b52f> (patch)
- <https://git.kernel.org/stable/c/e4d19e5d71b217940e33f2ef6c6962b7b68c5606> (patch)
- <https://git.kernel.org/stable/c/3830ab97cda9599872625cc0dc7b00160193634f> (patch)
- <https://git.kernel.org/stable/c/c9764fd88bc744592b0604ccb6b6fc1a5f76b4e3> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html> (third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html> (third-party-advisory)

## Sources

- CVE List: [CVE-2025-38395](https://www.cve.org/CVERecord?id=CVE-2025-38395), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2025-38395](https://nvd.nist.gov/vuln/detail/CVE-2025-38395), Public domain, modified 2026-07-30

---

Page: https://cve.day/CVE-2025-38395 · Whole record: https://cve.day/CVE-2025-38395.json · Rebuilt by cve.day 2026-11-25T22:59:01.688Z
