{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2025-39713","id":"CVE-2025-39713","title":"media: rainshadow-cec: fix TOCTOU race condition in rain_interrupt()","description":"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 wo","descriptionLong":"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.","published":"2025-09-05T17:21:20.459Z","updated":"2026-11-07T02:30:47.133803878Z","reserved":"2025-04-16T07:20:57.116Z","status":"Modified","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":4.7,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"},"metrics":[{"version":"3.1","score":4.7,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"}],"rating":"medium","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","lessThan":"2964dbe631fd21ad7873b1752b895548d3c12496","status":"affected","versionType":"git"},{"version":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","lessThan":"6aaef1a75985865d8c6c5b65fb54152060faba48","status":"affected","versionType":"git"},{"version":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","lessThan":"fbc81e78d75bf28972bc22b1599559557b1a1b83","status":"affected","versionType":"git"},{"version":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","lessThan":"3c3e33b7edca7a2d6a96801f287f9faeb684d655","status":"affected","versionType":"git"},{"version":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","lessThan":"1c2769dc80255824542ea5a4ff1a07dcdeb1603f","status":"affected","versionType":"git"},{"version":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","lessThan":"ed905fe7cba03cf22ae0b84cf1b73cd1c070423a","status":"affected","versionType":"git"},{"version":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","lessThan":"ff9dd3db6cd4c6b54a2ecbc58151bea4ec63bc59","status":"affected","versionType":"git"},{"version":"0f314f6c2e77beb1a232be21dd6be4e1849ba5ac","lessThan":"7af160aea26c7dc9e6734d19306128cce156ec40","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.12","status":"affected"},{"version":"0","lessThan":"4.12","status":"unaffected","versionType":"semver"},{"version":"5.4.297","lessThanOrEqual":"5.4.*","status":"unaffected","versionType":"semver"},{"version":"5.10.241","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.190","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.1.149","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.103","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.44","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.16.4","lessThanOrEqual":"6.16.*","status":"unaffected","versionType":"semver"},{"version":"6.17","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":["CWE-367"],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/2964dbe631fd21ad7873b1752b895548d3c12496","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/6aaef1a75985865d8c6c5b65fb54152060faba48","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/fbc81e78d75bf28972bc22b1599559557b1a1b83","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/3c3e33b7edca7a2d6a96801f287f9faeb684d655","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/1c2769dc80255824542ea5a4ff1a07dcdeb1603f","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/ed905fe7cba03cf22ae0b84cf1b73cd1c070423a","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/ff9dd3db6cd4c6b54a2ecbc58151bea4ec63bc59","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/7af160aea26c7dc9e6734d19306128cce156ec40","tags":["Patch","web"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["Third Party Advisory","web"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html","tags":["Third Party Advisory","web"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-032379.html","tags":["web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39713.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39713","tags":["advisory"]},{"url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00144,"epssPercentile":0.03757,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2025-39713","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39713","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2025-39713","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2025-39713","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}