CVE-2025-39713

MediumCVSS 4.7/10Last modified Nov 5, 2026

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.

Metrics

CVSS 3.1 4.7/10CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H

Weakness enumeration

Affected software

VendorProductVersions
LinuxLinux>= 0f314f6c2e77beb1a232be21dd6be4e1849ba5ac, < 2964dbe631fd21ad7873b1752b895548d3c12496; >= 0f314f6c2e77beb1a232be21dd6be4e1849ba5ac, < 6aaef1a75985865d8c6c5b65fb54152060faba48; >= 0f314f6c2e77beb1a232be21dd6be4e1849ba5ac, < fbc81e78d75bf28972bc22b1599559557b1a1b83; >= 0f314f6c2e77beb1a232be21dd6be4e1849ba5ac, < 3c3e33b7edca7a2d6a96801f287f9faeb684d655; >= 0f314f6c2e77beb1a232be21dd6be4e1849ba5ac, < 1c2769dc80255824542ea5a4ff1a07dcdeb1603f; >= 0f314f6c2e77beb1a232be21dd6be4e1849ba5ac, < ed905fe7cba03cf22ae0b84cf1b73cd1c070423a; >= 0f314f6c2e77beb1a232be21dd6be4e1849ba5ac, < ff9dd3db6cd4c6b54a2ecbc58151bea4ec63bc59; >= 0f314f6c2e77beb1a232be21dd6be4e1849ba5ac, < 7af160aea26c7dc9e6734d19306128cce156ec40
LinuxLinux4.12
SiemensSIMATIC CN 4100< V5.0

References

Timeline

Published
Sep 5, 2025
Last modified
Nov 5, 2026
NVD status
Modified

Related CVEs from 2025

CVE-2025-397145.5In the Linux kernel, the following vulnerability has been resolved: media: usbtv: Lock resolution while streaming When an program is streaCVE-2025-397155.5In the Linux kernel, the following vulnerability has been resolved: parisc: Revise gateway LWS calls to probe user read access We use loadCVE-2025-397165.5In the Linux kernel, the following vulnerability has been resolved: parisc: Revise __get_user() to probe user read access Because of the wCVE-2025-397177.8In the Linux kernel, the following vulnerability has been resolved: open_tree_attr: do not allow id-mapping changes without OPEN_TREE_CLONECVE-2025-397185.5In the Linux kernel, the following vulnerability has been resolved: vsock/virtio: Validate length in packet header before skb_put() When rCVE-2025-397197.1In the Linux kernel, the following vulnerability has been resolved: iio: imu: bno055: fix OOB access of hw_xlate array Fix a potential outCVE-2025-39729.8A vulnerability, which was classified as critical, has been found in PHPGurukul COVID19 Testing Management System 1.0. Affected by this issuCVE-2025-397205.5In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix refcount leak causing resource not released When ksmbd_connCVE-2025-397215.5In the Linux kernel, the following vulnerability has been resolved: crypto: qat - flush misc workqueue during device shutdown Repeated loaCVE-2025-397225.5In the Linux kernel, the following vulnerability has been resolved: crypto: caam - Prevent crash on suspend with iMX8QM / iMX8ULP Since thCVE-2025-397237.8In the Linux kernel, the following vulnerability has been resolved: netfs: Fix unbuffered write error handling If all the subrequests in aCVE-2025-397245.5In the Linux kernel, the following vulnerability has been resolved: serial: 8250: fix panic due to PSLVERR When the PSLVERR_RESP_EN parame
CVE-2025-39713: Medium severity, CVSS 4.7 | Vulnix