CVE-2025-39713
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-09-05

Last updated on: 2025-11-03

Assigner: kernel.org

Description
In the Linux kernel, the following vulnerability has been resolved: media: rainshadow-cec: fix TOCTOU race condition in rain_interrupt() In the interrupt handler rain_interrupt(), the buffer full check on rain->buf_len is performed before acquiring rain->buf_lock. This creates a Time-of-Check to Time-of-Use (TOCTOU) race condition, as rain->buf_len is concurrently accessed and modified in the work handler rain_irq_work_handler() under the same lock. Multiple interrupt invocations can race, with each reading buf_len before it becomes full and then proceeding. This can lead to both interrupts attempting to write to the buffer, incrementing buf_len beyond its capacity (DATA_SIZE) and causing a buffer overflow. Fix this bug by moving the spin_lock() to before the buffer full check. This ensures that the check and the subsequent buffer modification are performed atomically, preventing the race condition. An corresponding spin_unlock() is added to the overflow path to correctly release the lock. This possible bug was found by an experimental static analysis tool developed by our team.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-09-05
Last Modified
2025-11-03
Generated
2026-05-27
AI Q&A
2025-09-05
EPSS Evaluated
2026-05-25
NVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
linux linux_kernel 5.10.244
linux linux_kernel 6.1.153
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 is a Time-of-Check to Time-of-Use (TOCTOU) race condition in the Linux kernel's rainshadow-cec media driver. Specifically, in the interrupt handler rain_interrupt(), a check to see if the buffer is full is done before acquiring a lock on the buffer. Because the buffer length (buf_len) can be accessed and modified concurrently by another handler under the same lock, multiple interrupts can simultaneously read the buffer as not full and then both write to it. This can cause the buffer length to exceed its capacity, leading to a buffer overflow. The fix involves acquiring the lock before checking the buffer length to ensure atomicity and prevent the race condition.


How can this vulnerability impact me? :

This vulnerability can lead to a buffer overflow in the Linux kernel's rainshadow-cec driver. Buffer overflows can cause system instability, crashes, or potentially allow an attacker to execute arbitrary code with kernel privileges, compromising system security and reliability.


What immediate steps should I take to mitigate this vulnerability?

To mitigate this vulnerability, update the Linux kernel to a version where the rainshadow-cec driver has the fix applied. The fix involves moving the spin_lock() before the buffer full check in the rain_interrupt() handler to prevent the TOCTOU race condition and buffer overflow. Until the update is applied, avoid using the affected media rainshadow-cec functionality if possible.


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