CVE-2025-39713
kernel: media: rainshadow-cec: fix TOCTOU race condition in rain_interrupt()
Overview
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.
Source: OX vulnerability database
Severity
4.7 · MEDIUM
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Local
- Attack complexity
- High
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
Weakness: CWE-367
Affected packages · 0
No registry package. This ID affects operating system packages only.
Operating systems · 87 fixes
Oracle Linux 3 releases · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 7 | kernel-uek +7 | 5.4.17-2136.348.3.el7uek |
| 8 | bpftool +13 | 5.15.0-314.193.5.3.el8uek |
| 9 | bpftool +3 | 5.15.0-314.193.5.3.el9uek |
| 9 | kernel-uek +34 | 6.12.0-105.51.5.el9uek |
Photon OS 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 4.0 | bpftool +9 | 5.10.241-1.ph4 |
| 5.0 | bpftool +10 | 6.1.153-1.ph5 |
Red Hat 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 9 | bpftool +106 | affected |
SUSE Linux Enterprise 3 releases · 7 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.6 | kernel-livepatch-6-4-0-150600-10-55-rt | 1-150600.1.3.1 | SUSE-SU-2025:3751-1 |
| 15.6 | kernel-livepatch-6-4-0-150600-23-73-default | 1-150600.13.3.1 | SUSE-SU-2025:03600-1 |
| 15.6 | cluster-md-kmp-default +18 | 6.4.0-150600.23.73.1 | SUSE-SU-2025:03600-1 |
| 15.6 | kernel-default-base | 6.4.0-150600.23.73.1.150600.12.32.1 | SUSE-SU-2025:03600-1 |
| 15.6 | kernel-azure +4 | 6.4.0-150600.8.52.1 | SUSE-SU-2025:03634-1 |
| 15.7 | kernel-livepatch-6-4-0-150700-7-22-rt | 1-150700.1.3.1 | SUSE-SU-2025:4141-1 |
6 more rows
SUSE Linux Enterprise Micro 3 releases · 4 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 6.0 | kernel-default +5 | 6.4.0-35.1 | SUSE-SU-2025:20851-1 |
| 6.0 | kernel-default-base | 6.4.0-35.1.21.12 | SUSE-SU-2025:20851-1 |
| 6.0 | kernel-devel-rt +3 | 6.4.0-37.1 | SUSE-SU-2025:20870-1 |
| 6.1 | kernel-default +6 | 6.4.0-35.1 | SUSE-SU-2025:20861-1 |
| 6.1 | kernel-default-base | 6.4.0-35.1.21.12 | SUSE-SU-2025:20861-1 |
| 6.1 | kernel-devel-rt +4 | 6.4.0-37.1 | SUSE-SU-2025:20898-1 |
2 more rows
debian 4 releases · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 11 | linux | 5.10.244-1 |
| 11 | linux-6-1 | 6.1.153-1~deb11u1 |
| 12 | linux | 6.1.153-1 |
| 13 | linux | 6.12.48-1 |
| 14 | linux | 6.16.5-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| linux | 1 |
openSUSE Leap 1 release · 2 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 16.0 | cluster-md-kmp-64kb +64 | 6.12.0-160000.6.1 | openSUSE-SU-2025:20081-1 |
| 16.0 | kernel-default-base | 6.12.0-160000.6.1.160000.2.4 | openSUSE-SU-2025:20081-1 |
root.io debian 3 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 11 | linux +1 | 5.10.244-1 |
| 12 | linux +1 | 6.1.153-1 |
| 13 | linux +1 | 6.12.48-1 |
root.io ubuntu 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 22.04 | linux +1 | 5.15.0-163.173 |
| 24.04 | linux +1 | 6.8.0-100.100 |
ubuntu 3 releases · 37 packages
| Release | Package | Fixed in |
|---|---|---|
| 20.04-ESM | linux-nvidia-tegra-5-15 | 5.15.0-1049.49~20.04.1 |
| 20.04-ESM | linux-ibm-5-15 | 5.15.0-1091.94~20.04.1 |
| 20.04-ESM | linux-riscv-5-15 | 5.15.0-1092.96~20.04.1 |
| 20.04-ESM | linux-intel-iotg-5-15 | 5.15.0-1092.98~20.04.1 |
| 20.04-ESM | linux-oracle-5-15 | 5.15.0-1094.100~20.04.1 |
| 20.04-ESM | linux-aws-5-15 | 5.15.0-1097.104~20.04.1 |
41 more rows
References
- access.redhat.com https://access.redhat.com/security/cve/CVE-2025-39713
- cert-portal.siemens.com https://cert-portal.siemens.com/productcert/html/ssa-032379.html
- git.kernel.org https://git.kernel.org/linus/7af160aea26c7dc9e6734d19306128cce156ec40 (6.17-rc1)
- git.kernel.org https://git.kernel.org/stable/c/1c2769dc80255824542ea5a4ff1a07dcdeb1603f
- git.kernel.org https://git.kernel.org/stable/c/2964dbe631fd21ad7873b1752b895548d3c12496
- git.kernel.org https://git.kernel.org/stable/c/3c3e33b7edca7a2d6a96801f287f9faeb684d655
- git.kernel.org https://git.kernel.org/stable/c/6aaef1a75985865d8c6c5b65fb54152060faba48
- git.kernel.org https://git.kernel.org/stable/c/7af160aea26c7dc9e6734d19306128cce156ec40
- git.kernel.org https://git.kernel.org/stable/c/ed905fe7cba03cf22ae0b84cf1b73cd1c070423a
- git.kernel.org https://git.kernel.org/stable/c/fbc81e78d75bf28972bc22b1599559557b1a1b83
Show all 43 references
- git.kernel.org https://git.kernel.org/stable/c/ff9dd3db6cd4c6b54a2ecbc58151bea4ec63bc59
- linux.oracle.com https://linux.oracle.com/cve/CVE-2025-39713.html
- linux.oracle.com https://linux.oracle.com/errata/ELSA-2025-25757.html
- lists.debian.org https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html
- lists.debian.org https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html
- lore.kernel.org https://lore.kernel.org/linux-cve-announce/2025090550-CVE-2025-39713-ec93@gregkh/T
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2025-39713
- ubuntu.com https://ubuntu.com/security/notices/USN-7909-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7909-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7909-3
- ubuntu.com https://ubuntu.com/security/notices/USN-7909-4
- ubuntu.com https://ubuntu.com/security/notices/USN-7909-5
- ubuntu.com https://ubuntu.com/security/notices/USN-7910-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7910-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7933-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7938-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8028-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8028-2
- ubuntu.com https://ubuntu.com/security/notices/USN-8028-3
- ubuntu.com https://ubuntu.com/security/notices/USN-8028-4
- ubuntu.com https://ubuntu.com/security/notices/USN-8028-5
- ubuntu.com https://ubuntu.com/security/notices/USN-8028-6
- ubuntu.com https://ubuntu.com/security/notices/USN-8028-7
- ubuntu.com https://ubuntu.com/security/notices/USN-8028-8
- ubuntu.com https://ubuntu.com/security/notices/USN-8031-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8031-2
- ubuntu.com https://ubuntu.com/security/notices/USN-8031-3
- ubuntu.com https://ubuntu.com/security/notices/USN-8052-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8052-2
- ubuntu.com https://ubuntu.com/security/notices/USN-8074-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8074-2
- ubuntu.com https://ubuntu.com/security/notices/USN-8126-1
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2025-39713
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.