CVE-2026-31732
Awaiting Analysis Awaiting Analysis - Queue
Resource Leak in Linux Kernel GPIO Subsystem

Publication date: 2026-05-01

Last updated on: 2026-05-01

Assigner: kernel.org

Description
In the Linux kernel, the following vulnerability has been resolved: gpio: Fix resource leaks on errors in gpiochip_add_data_with_key() Since commit aab5c6f20023 ("gpio: set device type for GPIO chips"), `gdev->dev.release` is unset. As a result, the reference count to `gdev->dev` isn't dropped on the error handling paths. Drop the reference on errors. Also reorder the instructions to make the error handling simpler. Now gpiochip_add_data_with_key() roughly looks like: >>> Some memory allocation. Go to ERR ZONE 1 on errors. >>> device_initialize(). gpiodev_release() takes over the responsibility for freeing the resources of `gdev->dev`. The subsequent error handling paths shouldn't go through ERR ZONE 1 again which leads to double free. >>> Some initialization mainly on `gdev`. >>> The rest of initialization. Go to ERR ZONE 2 on errors. >>> Chip registration success and exit. >>> ERR ZONE 2. gpio_device_put() and exit. >>> ERR ZONE 1.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-05-01
Last Modified
2026-05-01
Generated
2026-05-07
AI Q&A
2026-05-02
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
linux linux_kernel *
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-UNKNOWN
Attack-Flow Graph
AI Powered Q&A
What immediate steps should I take to mitigate this vulnerability?

The vulnerability is fixed in the Linux kernel by correcting resource leaks in the gpiochip_add_data_with_key() function. To mitigate this vulnerability, you should update your Linux kernel to a version that includes the fix for this issue.

  • Identify your current Linux kernel version.
  • Check for available kernel updates from your distribution or kernel source that include the fix.
  • Apply the kernel update and reboot your system to use the patched kernel.
  • Avoid using unpatched kernels where gpiochip_add_data_with_key() may leak resources on error paths.

Can you explain this vulnerability to me?

This vulnerability is related to the Linux kernel's GPIO subsystem, specifically in the function gpiochip_add_data_with_key(). The issue arises because the device release function (gdev->dev.release) is unset, which causes the reference count to the device (gdev->dev) not to be properly decremented during error handling. This leads to resource leaks when errors occur.

The fix involves dropping the reference on errors and reordering instructions to simplify error handling, ensuring that resources are properly freed and preventing leaks or double frees.


How can this vulnerability impact me? :

This vulnerability can lead to resource leaks in the Linux kernel's GPIO subsystem. Resource leaks may cause increased memory usage or exhaustion of kernel resources, potentially leading to system instability or degraded performance.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart