CVE-2026-139285

gpiolib: fix memory leak in gpiod_set_array_value_complex() EPERM error path

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

gpiolib: fix memory leak in gpiod_set_array_value_complex() EPERM error path

A drive-by review by Sashiko reports that, where the line has not been
configured as an output, gpiod_set_array_value_complex() can return
without freeing potentially alloced bitmaps, thus leaking memory.

Cleanup the bitmaps before returning.

Analysis

AI-generated

Technical impact

A memory leak occurs when the kernel routine responsible for setting GPIO values is called on a line that is not configured as an output. In this scenario, the routine returns early on an EPERM error without freeing allocated bitmaps, causing a heap-based memory leak. The leaked memory can accumulate over time, potentially exhausting system resources and leading to a denial of service. This weakness is a classic example of a heap memory leak (CWE‑401).

Affected Systems

All Linux kernel implementations are affected, as the issue resides in the core gpiolib subsystem. No specific version numbers are listed in the advisory, but any kernel build lacking the applied fix will be vulnerable until the patch is deployed. System administrators should verify that their kernels are at least at the patched revision before the fix is applied.

Risk and Exploitability

The CVSS score and EPSS metric are not supplied, and the vulnerability is not currently listed in the CISA KEV catalog. The exploitability is likely limited to environments where a local or privileged actor can trigger the problematic function call, such as a malicious driver or misconfigured application using the GPIO API. Repeated leaks could degrade performance or cause the kernel to run out of address space, which is new enough to be monitored but not yet widely exploited.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Replace the running kernel with a version that includes the gpiolib memory‑leak fix
  • If an immediate kernel upgrade is not possible, monitor memory usage for abnormal bitmap growth and plan a reboot or kernel restart once thresholds are breached
  • Review and correct GPIO configuration logic in user-space or driver code to ensure that lines are set as outputs before invoking the problematic routine

Generated by OpenCVE AI on November 30, 2026 at 21:09 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-401
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: gpiolib: fix memory leak in gpiod_set_array_value_complex() EPERM error path A drive-by review by Sashiko reports that, where the line has not been configured as an output, gpiod_set_array_value_complex() can return without freeing potentially alloced bitmaps, thus leaking memory. Cleanup the bitmaps before returning.
Title gpiolib: fix memory leak in gpiod_set_array_value_complex() EPERM error path
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-401

    Missing Release of Memory after Effective Lifetime

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:33 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM