Skip to main content
EPSS 0.1%top 96%

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)

0
Medium
Published: 12/04/2025 (12/04/2025, 16:16:00 UTC)
Source: GCVE Database
Product: linux-hwe-edge

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

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected software

Affected versions
<6.17.0-1009.9~24.04.2<6.17.0-1010.10~24.04.1<6.17.0-1009.9~24.04.3<6.17.0-19.19~24.04.2<6.17.0-1018.18

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/30/2026, 17:24:00 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses