Linux hwe edge: In the Linux kernel, the following vulnerability has been resolved: gpio: cdev: make sure the cdev fd is still active before emitting events With… (CVE-2025-40249)
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.
AI Analysis
Technical Summary
CVE-2025-40249 addresses a use-after-free vulnerability in the Linux kernel's gpio cdev subsystem. The problem occurs when the final fput() call on a file descriptor defers the release action to a work queue, leaving the reference count at zero. If a GPIO event triggers a notification after the reference count drops but before the .release() callback unregisters the notifier, the system attempts to increment the file's reference count using get_file(), which is unsafe in this context. The fix replaces get_file() with get_file_active(), which returns NULL if the file descriptor is being released or already released, preventing the use-after-free condition.
Potential Impact
This vulnerability can lead to a use-after-free condition in the Linux kernel, potentially causing memory corruption. The CVSS vector indicates high impact on confidentiality, integrity, and availability (C:H/I:H/A:H). An attacker with local privileges could exploit this to cause system instability or escalate privileges.
Mitigation Recommendations
The vulnerability has been resolved in the Linux kernel by changing the code to use get_file_active() instead of get_file() to ensure the file descriptor is active before use. Although no explicit patch links are provided here, users should apply the official Linux kernel updates that include this fix. Patch status is not yet confirmed from vendor advisory; check the official Linux kernel security advisories for the current remediation guidance.
Linux hwe edge: In the Linux kernel, the following vulnerability has been resolved: gpio: cdev: make sure the cdev fd is still active before emitting events With… (CVE-2025-40249)
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 v3.1
Score 7.8high
Affected software
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2025-40249 addresses a use-after-free vulnerability in the Linux kernel's gpio cdev subsystem. The problem occurs when the final fput() call on a file descriptor defers the release action to a work queue, leaving the reference count at zero. If a GPIO event triggers a notification after the reference count drops but before the .release() callback unregisters the notifier, the system attempts to increment the file's reference count using get_file(), which is unsafe in this context. The fix replaces get_file() with get_file_active(), which returns NULL if the file descriptor is being released or already released, preventing the use-after-free condition.
Potential Impact
This vulnerability can lead to a use-after-free condition in the Linux kernel, potentially causing memory corruption. The CVSS vector indicates high impact on confidentiality, integrity, and availability (C:H/I:H/A:H). An attacker with local privileges could exploit this to cause system instability or escalate privileges.
Mitigation Recommendations
The vulnerability has been resolved in the Linux kernel by changing the code to use get_file_active() instead of get_file() to ensure the file descriptor is active before use. Although no explicit patch links are provided here, users should apply the official Linux kernel updates that include this fix. Patch status is not yet confirmed from vendor advisory; check the official Linux kernel security advisories for the current remediation guidance.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-p8p4-x362-gp65
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-40249"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a6b72d59c2644c7f847993a
Added to database: 07/30/2026, 15:50:45 UTC
Last enriched: 07/30/2026, 17:24:00 UTC
Last updated: 09/10/2026, 19:24:56 UTC
Views: 19
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.