CVE-2025-40249: gpio: cdev: make sure the cdev fd is still active before emitting events

Published Dec 4, 2025
·
Updated

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 getfile() routine in this situation triggers the following warning:

struct file::fcount incremented from zero; use-after-free condition present!

So use the getfileactive() variant that will return NULL on file descriptors that have been or are being released.

Affected Software

1 affected component
linux-kernel

Event History

Dec 4, 2025
CVE Published
via MITRE·04:08 PM
Data Sourced
via MITRE·04:08 PM
DescriptionSeverity
Data Sourced
via NVD·04:16 PM
DescriptionSeverity
Data Sourced
via Red Hat·05:03 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-40249?

CVE-2025-40249 has been classified with a medium severity rating.

2

How do I fix CVE-2025-40249?

To fix CVE-2025-40249, update your Linux kernel to the latest version that includes the security patch.

3

What systems are affected by CVE-2025-40249?

CVE-2025-40249 affects various versions of the Linux kernel.

4

What are the potential impacts of CVE-2025-40249?

Exploitation of CVE-2025-40249 may lead to issues with file descriptor management and event emission.

5

Is CVE-2025-40249 actively being exploited?

As of now, there is no public knowledge of active exploitation for CVE-2025-40249.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203