CVE-2025-38395

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

HIGH
7.1
CVSS Score
Published: July 25, 2025 at 12:53 PM UTC
Updated: August 5, 2026 at 12:44 PM UTC
2 products affected across 2 vendorsLinux KernelDebian Linux

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.1
Exploit prediction
EPSS 0.2%

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

5.1 ≤ v < 5.10.2405.1 ≤ v < 5.15.1875.1 ≤ v < 5.4.2965.1 ≤ v < 6.1.1445.1 ≤ v < 6.12.375.1 ≤ v < 6.15.65.1 ≤ v < 6.165.1 ≤ v < 6.6.975.11 ≤ v < 5.15.1875.16 ≤ v < 6.1.1445.5 ≤ v < 5.10.2406.13 ≤ v < 6.15.66.2 ≤ v < 6.6.976.7 ≤ v < 6.12.376.16 rc16.16 rc26.16 rc36.16 rc4d6cd33ad71029a3f77ba1686caf55d4dea58d916
Vendor states this is fixed in 24418bc77a66cb5be9f5a837431ba3674ed8b52f (fixed)
Vendor states this is fixed in 3830ab97cda9599872625cc0dc7b00160193634f (fixed)
Vendor states this is fixed in 56738cbac3bbb1d39a71a07f57484dec1db8b239 (fixed)
Vendor states this is fixed in 9fe71972869faed1f8f9b3beb9040f9c1b300c79 (fixed)
Vendor states this is fixed in a1e12fac214d4f49fcb186dbdf9c5592e7fa0a7a (fixed)
Vendor states this is fixed in a3cd5ae7befbac849e0e0529c94ca04e8093cfd2 (fixed)
Vendor states this is fixed in c9764fd88bc744592b0604ccb6b6fc1a5f76b4e3 (fixed)
Vendor states this is fixed in e4d19e5d71b217940e33f2ef6c6962b7b68c5606 (fixed)
Vendor states this is fixed in 5.1 (unaffected)
Vendor states this is fixed in 5.10.240 (unaffected)
Vendor states this is fixed in 5.15.187 (unaffected)
Vendor states this is fixed in 5.4.296 (unaffected)
Vendor states this is fixed in 6.1.144 (unaffected)
Vendor states this is fixed in 6.12.37 (unaffected)
Vendor states this is fixed in 6.15.6 (unaffected)
Vendor states this is fixed in 6.16 (unaffected)
Vendor states this is fixed in 6.6.97 (unaffected)

References (10)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/24418bc77a66cb5be9f5a837431ba3674ed8b52f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/3830ab97cda9599872625cc0dc7b00160193634f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/56738cbac3bbb1d39a71a07f57484dec1db8b239
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/9fe71972869faed1f8f9b3beb9040f9c1b300c79
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/a1e12fac214d4f49fcb186dbdf9c5592e7fa0a7a
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/a3cd5ae7befbac849e0e0529c94ca04e8093cfd2
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/c9764fd88bc744592b0604ccb6b6fc1a5f76b4e3
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e4d19e5d71b217940e33f2ef6c6962b7b68c5606

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-125

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card