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.
No analysis available yet.
No remediation available yet.
Tracking
Sign in to view the affected projects.
| Source | ID | Title |
|---|---|---|
Debian DLA |
DLA-4327-1 | linux security update |
Debian DLA |
DLA-4328-1 | linux-6.1 security update |
Debian DSA |
DSA-6008-1 | linux security update |
Debian DSA |
DSA-6009-1 | linux security update |
EUVD |
EUVD-2025-31514 | 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. |
Ubuntu USN |
USN-7909-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7909-2 | Linux kernel (Real-time) vulnerabilities |
Ubuntu USN |
USN-7909-3 | Linux kernel (FIPS) vulnerabilities |
Ubuntu USN |
USN-7910-1 | Linux kernel (Azure FIPS) vulnerabilities |
Ubuntu USN |
USN-7909-4 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7910-2 | Linux kernel (Azure) vulnerabilities |
Ubuntu USN |
USN-7909-5 | Linux kernel (Raspberry Pi) vulnerabilities |
Ubuntu USN |
USN-7933-1 | Linux kernel (KVM) vulnerabilities |
Ubuntu USN |
USN-7938-1 | Linux kernel (Azure) vulnerabilities |
Ubuntu USN |
USN-8028-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-8028-2 | Linux kernel (Real-time) vulnerabilities |
Ubuntu USN |
USN-8031-1 | Linux kernel (GCP) vulnerabilities |
Ubuntu USN |
USN-8028-3 | Linux kernel (Real-time) vulnerabilities |
Ubuntu USN |
USN-8028-4 | Linux kernel (FIPS) vulnerabilities |
Ubuntu USN |
USN-8028-5 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-8031-2 | Linux kernel (GCP FIPS) vulnerabilities |
Ubuntu USN |
USN-8028-6 | Linux kernel (HWE) vulnerabilities |
Ubuntu USN |
USN-8031-3 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-8052-1 | Linux kernel (Low Latency) vulnerabilities |
Ubuntu USN |
USN-8028-7 | Linux kernel (Low Latency NVIDIA) vulnerabilities |
Ubuntu USN |
USN-8028-8 | Linux kernel (IBM) vulnerabilities |
Ubuntu USN |
USN-8052-2 | Linux kernel (Xilinx) vulnerabilities |
Ubuntu USN |
USN-8074-1 | Linux kernel (Azure) vulnerabilities |
Ubuntu USN |
USN-8074-2 | Linux kernel (Azure FIPS) vulnerabilities |
Ubuntu USN |
USN-8126-1 | Linux kernel (Azure) vulnerabilities |
Wed, 07 Jan 2026 20:45:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Debian
Debian debian Linux |
|
| Weaknesses | CWE-367 | |
| CPEs | cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
|
| Vendors & Products |
Debian
Debian debian Linux |
|
| Metrics |
cvssV3_1
|
cvssV3_1
|
Mon, 03 Nov 2025 18:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| References |
|
Sat, 06 Sep 2025 09:15:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Linux
Linux linux Kernel |
|
| Vendors & Products |
Linux
Linux linux Kernel |
Sat, 06 Sep 2025 00:15:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| References |
| |
| Metrics |
threat_severity
|
cvssV3_1
|
Fri, 05 Sep 2025 17:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| 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. | |
| Title | media: rainshadow-cec: fix TOCTOU race condition in rain_interrupt() | |
| References |
|
|
Status: PUBLISHED
Assigner: Linux
Published:
Updated: 2025-11-03T17:42:39.229Z
Reserved: 2025-04-16T07:20:57.116Z
Link: CVE-2025-39713
No data.
Status : Analyzed
Published: 2025-09-05T18:15:48.720
Modified: 2026-01-07T20:39:57.930
Link: CVE-2025-39713
OpenCVE Enrichment
Updated: 2025-09-06T09:01:29Z
Debian DLA
Debian DSA
EUVD
Ubuntu USN