All reports
Medium

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

Affected versions

Affected versions
Unknown
Fixed version
Not reported

Exploitation

CVE-2025-38395

Probability of exploitation in the next 30 days: 0.21%

FIRST EPSS · 2026-11-19

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.

A flaw was found in the Linux kernel's General Purpose Input/Output (GPIO) regulator driver. The driver allocates insufficient memory when configuring a device that uses multiple GPIO pins, leading to an out-of-bounds memory access. A local attacker with privileged administrative access could exploit this flaw by providing a crafted regulator configuration, potentially causing a system crash and resulting in a Denial of Service (DoS).