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

High 8.4 Published Updated

An out-of-bounds memory access in the Linux kernel GPIO regulator driver can lead to system crashes or potential code execution.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-38395?

CVE-2025-38395 is a high-severity memory corruption vulnerability in Debian Debian Linux, published on 25 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Weakness: CWE-125

Which versions are affected by CVE-2025-38395?

It affects 2 products.

Products include Debian Debian Linux, Linux kernel.

How do I fix CVE-2025-38395?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2025-38395 being exploited?

There is no known exploitation of CVE-2025-38395 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as AZL-65798, AZL-73013, BELL-CVE-2025-38395, DEBIAN-CVE-2025-38395, GHSA-3fxq-g92j-92g5, ROOT-OS-DEBIAN-11-CVE-2025-38395 and 4 more.

Is CVE-2025-38395 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free