CVE-2025-40249
Awaiting Analysis Awaiting Analysis - Queue
BaseFortify

Publication date: 2025-12-04

Last updated on: 2025-12-04

Assigner: kernel.org

Description
In the Linux kernel, the following vulnerability has been resolved: gpio: cdev: make sure the cdev fd is still active before emitting events With the final call to fput() on a file descriptor, the release action may be deferred and scheduled on a work queue. The reference count of that descriptor is still zero and it must not be used. It's possible that a GPIO change, we want to notify the user-space about, happens AFTER the reference count on the file descriptor associated with the character device went down to zero but BEFORE the .release() callback was called from the workqueue and so BEFORE we unregistered from the notifier. Using the regular get_file() routine in this situation triggers the following warning: struct file::f_count incremented from zero; use-after-free condition present! So use the get_file_active() variant that will return NULL on file descriptors that have been or are being released.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-12-04
Last Modified
2025-12-04
Generated
2026-05-07
AI Q&A
2025-12-04
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Currently, no data is known.
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-UNKNOWN
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability occurs in the Linux kernel's GPIO character device handling. When a file descriptor (fd) associated with the GPIO character device is closed, the release action may be deferred and executed later on a work queue. During this time, the reference count of the fd is zero, meaning it should not be used. However, a GPIO event notification might happen after the reference count has dropped to zero but before the release callback is executed, leading to a use-after-free condition if the code tries to access the fd. The vulnerability is fixed by using a safer method (get_file_active()) that returns NULL if the fd is being released, preventing the use-after-free.


How can this vulnerability impact me? :

This vulnerability can lead to a use-after-free condition in the Linux kernel, which may cause system instability, crashes, or potentially allow an attacker to execute arbitrary code or escalate privileges by exploiting the improper handling of GPIO character device file descriptors.


What immediate steps should I take to mitigate this vulnerability?

Update the Linux kernel to a version where this vulnerability is resolved. The fix involves ensuring that the character device file descriptor (cdev fd) is still active before emitting events by using the get_file_active() variant instead of get_file(), preventing use-after-free conditions. Applying the official patch or kernel update that includes this fix is the recommended mitigation.


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