CVE-2025-40096drm/sched: Fix potential double free in drm_sched_job_add_resv_dependencies
- 7.8HighCVSS base score
- 0.15%Exploitation in 30 daysEPSS · top 95% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
Description
In the Linux kernel, the following vulnerability has been resolved: drm/sched: Fix potential double free in drm_sched_job_add_resv_dependencies When adding dependencies with drm_sched_job_add_dependency(), that function consumes the fence reference both on success and failure, so in the latter case the dma_fence_put() on the error path (xarray failed to expand) is a double free. Interestingly this bug appears to have been present ever since commit ebd5f74255b9 ("drm/sched: Add dependency tracking"), since the code back then looked like this: drm_sched_job_add_implicit_dependencies(): ... for (i = 0; i < fence_count; i++) { ret = drm_sched_job_add_dependency(job, fences[i]); if (ret) break; } for (; i < fence_count; i++) dma_fence_put(fences[i]); Which means for the failing 'i' the dma_fence_put was already a double free. Possibly there were no users at that time, or the test cases were insufficient to hit it. The bug was then only noticed and fixed after commit 9c2ba265352a ("drm/scheduler: use new iterator in drm_sched_job_add_implicit_dependencies v2") landed, with its fixup of commit 4eaf02d6076c ("drm/scheduler: fix drm_sched_job_add_implicit_dependencies"). At that point it was a slightly different flavour of a double free, which commit 963d0b356935 ("drm/scheduler: fix drm_sched_job_add_implicit_dependencies harder") noticed and attempted to fix. But it only moved the double free from happening inside the drm_sched_job_add_dependency(), when releasing the reference not yet obtained, to the caller, when releasing the reference already released by the former in the failure case. As such it is not easy to identify the right target for the fixes tag so lets keep it simple and just continue the chain. While fixing we also improve the comment and explain the reason for taking the reference and not dropping it.
Timeline
ID reserved
By Linux
- 7 months later
· 7 months later
Published
- 9 months later
· 9 months later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| LinuxCNA (assigner) | 3.1 | High7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVDNVD · Deferred | 3.1 | High7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 0.15% · top 95% of all CVEs (16 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: partial
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 7.8.
Affected products
- affected 963d0b3569354230f6e2c36a286ef270a8901878 – < 4c38a63ae12ecc9370a7678077bde2d61aa80e9c
- affected 963d0b3569354230f6e2c36a286ef270a8901878 – < 57239762aa90ad768dac055021f27705dae73344
- affected 963d0b3569354230f6e2c36a286ef270a8901878 – < e5e3eb2aff92994ee81ce633f1c4e73bd4b87e11
- affected 963d0b3569354230f6e2c36a286ef270a8901878 – < fdfb47e85af1e11ec822c82739dde2dd8dff5115
- affected 963d0b3569354230f6e2c36a286ef270a8901878 – < 5801e65206b065b0b2af032f7f1eef222aa2fd83
- affected 5.16
- unaffected < 5.16
- unaffected 6.1.158 – ≤ 6.1.*
- unaffected 6.6.114 – ≤ 6.6.*
- unaffected 6.12.55 – ≤ 6.12.*
- unaffected 6.17.5 – ≤ 6.17.*
- unaffected 6.18 – ≤ *
References
References5
- https://git.kernel.org/stable/c/4c38a63ae12ecc9370a7678077bde2d61aa80e9c (opens in a new tab)
- https://git.kernel.org/stable/c/57239762aa90ad768dac055021f27705dae73344 (opens in a new tab)
- https://git.kernel.org/stable/c/e5e3eb2aff92994ee81ce633f1c4e73bd4b87e11 (opens in a new tab)
- https://git.kernel.org/stable/c/fdfb47e85af1e11ec822c82739dde2dd8dff5115 (opens in a new tab)
- https://git.kernel.org/stable/c/5801e65206b065b0b2af032f7f1eef222aa2fd83 (opens in a new tab)
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2025-36982 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisories (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2025-40096)Record last updated .