{"id":"CVE-2025-39713","aliases":["CVE-2025-39713"],"related":[],"kind":"vulnerability","state":"published","title":"media: rainshadow-cec: fix TOCTOU race condition in rain_interrupt()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: rainshadow-cec: fix TOCTOU race condition in rain_interrupt()\n\nIn the interrupt handler rain_interrupt(), the buffer full check on\nrain->buf_len is performed before acquiring rain->buf_lock. This\ncreates a Time-of-Check to Time-of-Use (TOCTOU) race condition, as\nrain->buf_len is concurrently accessed and modified in the work\nhandler rain_irq_work_handler() under the same lock.\n\nMultiple interrupt invocations can race, with each reading buf_len\nbefore it becomes full and then proceeding. This can lead to both\ninterrupts attempting to write to the buffer, incrementing buf_len\nbeyond its capacity (DATA_SIZE) and causing a buffer overflow.\n\nFix this bug by moving the spin_lock() to before the buffer full\ncheck. This ensures that the check and the subsequent buffer modification\nare performed atomically, preventing the race condition. An corresponding\nspin_unlock() is added to the overflow path to correctly release the\nlock.\n\nThis possible bug was found by an experimental static analysis tool\ndeveloped by our team.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: rainshadow-cec: fix TOCTOU race condition in rain_interrupt()\n\nIn the interrupt handler rain_interrupt(), the buffer full check on\nrain->buf_len is performed before acquiring rain->buf_lock. This\ncreates a Time-of-Check to Time-of-Use (TOCTOU) race condition, as\nrain->buf_len is concurrently accessed and modified in the work\nhandler rain_irq_work_handler() under the same lock.\n\nMultiple interrupt invocations can race, with each reading buf_len\nbefore it becomes full and then proceeding. This can lead to both\ninterrupts attempting to write to the buffer, incrementing buf_len\nbeyond its capacity (DATA_SIZE) and causing a buffer overflow.\n\nFix this bug by moving the spin_lock() to before the buffer full\ncheck. This ensures that the check and the subsequent buffer modification\nare performed atomically, preventing the race condition. An corresponding\nspin_unlock() is added to the overflow path to correctly release the\nlock.\n\nThis possible bug was found by an experimental static analysis tool\ndeveloped by our team.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nmedia: rainshadow-cec: corrección de una condición de carrera TOCTOU en rain_interrupt()\n\nEn el gestor de interrupciones rain_interrupt(), la comprobación de búfer lleno en rain->buf_len se realiza antes de adquirir rain->buf_lock. Esto crea una condición de carrera de Tiempo de Comprobación a Tiempo de Uso (TOCTOU), ya que rain->buf_len es accedido y modificado concurrentemente en el gestor de trabajo rain_irq_work_handler() bajo el mismo bloqueo.\n\nMúltiples invocaciones de interrupción pueden competir, con cada una leyendo buf_len antes de que se llene y luego procediendo. Esto puede llevar a que ambas interrupciones intenten escribir en el búfer, incrementando buf_len más allá de su capacidad (DATA_SIZE) y causando un desbordamiento de búfer.\n\nSe corrige este error moviendo el spin_lock() a antes de la comprobación de búfer lleno. Esto asegura que la comprobación y la modificación posterior del búfer se realicen atómicamente, previniendo la condición de carrera. Se añade un spin_unlock() correspondiente a la ruta de desbordamiento para liberar correctamente el bloqueo.\n\nEste posible error fue encontrado por una herramienta experimental de análisis estático desarrollada por nuestro equipo.","source":"nvd"}],"published":"2025-09-05T17:21:20.459Z","modified":"2026-11-05T22:17:28.297Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"}],"cwes":["CWE-367"],"affected":[{"ranges":[{"type":"git","introduced":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","fixed":"2964dbe631fd21ad7873b1752b895548d3c12496","status":"affected"},{"type":"git","introduced":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","fixed":"6aaef1a75985865d8c6c5b65fb54152060faba48","status":"affected"},{"type":"git","introduced":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","fixed":"fbc81e78d75bf28972bc22b1599559557b1a1b83","status":"affected"},{"type":"git","introduced":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","fixed":"3c3e33b7edca7a2d6a96801f287f9faeb684d655","status":"affected"},{"type":"git","introduced":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","fixed":"1c2769dc80255824542ea5a4ff1a07dcdeb1603f","status":"affected"},{"type":"git","introduced":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","fixed":"ed905fe7cba03cf22ae0b84cf1b73cd1c070423a","status":"affected"},{"type":"git","introduced":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","fixed":"ff9dd3db6cd4c6b54a2ecbc58151bea4ec63bc59","status":"affected"},{"type":"git","introduced":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","fixed":"7af160aea26c7dc9e6734d19306128cce156ec40","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.12","status":"unaffected"},{"type":"semver","introduced":"5.4.297","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.241","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.190","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.149","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.103","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.44","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.16.4","lastAffected":"6.16.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.17","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"4.12","fixed":"5.4.297"},{"status":"affected","introduced":"5.5","fixed":"5.10.241"},{"status":"affected","introduced":"5.11","fixed":"5.15.190"},{"status":"affected","introduced":"5.16","fixed":"6.1.149"},{"status":"affected","introduced":"6.2","fixed":"6.6.103"},{"status":"affected","introduced":"6.7","fixed":"6.12.44"},{"status":"affected","introduced":"6.13","fixed":"6.16.4"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/2964dbe631fd21ad7873b1752b895548d3c12496","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6aaef1a75985865d8c6c5b65fb54152060faba48","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fbc81e78d75bf28972bc22b1599559557b1a1b83","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3c3e33b7edca7a2d6a96801f287f9faeb684d655","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1c2769dc80255824542ea5a4ff1a07dcdeb1603f","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ed905fe7cba03cf22ae0b84cf1b73cd1c070423a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ff9dd3db6cd4c6b54a2ecbc58151bea4ec63bc59","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7af160aea26c7dc9e6734d19306128cce156ec40","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-032379.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T21:08:41.457Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-39713","url":"https://www.cve.org/CVERecord?id=CVE-2025-39713","licence":"CVE Terms of Use","modified":"2026-11-05T21:12:55.445Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-39713","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39713","licence":"Public domain","modified":"2026-11-05T22:17:28.297Z"}],"updatedAt":"2026-11-25T22:59:04.277Z","epss":{"score":0.00153,"percentile":0.04691,"date":"2026-12-02T12:00:21.000Z"}}