CVE-2025-40096
Last modified
CVE-2025-40096 is a high-severity vulnerability rated 7.8/10 on the CVSS scale. 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.. EPSS estimates a 0.19% chance of exploitation in the next 30 days.
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.
Metrics
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Affected Software
Source: CNA advisory (CVE.org). NVD analysis pending.
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | >= 963d0b3569354230f6e2c36a286ef270a8901878, < 4c38a63ae12ecc9370a7678077bde2d61aa80e9c; >= 963d0b3569354230f6e2c36a286ef270a8901878, < 57239762aa90ad768dac055021f27705dae73344; >= 963d0b3569354230f6e2c36a286ef270a8901878, < e5e3eb2aff92994ee81ce633f1c4e73bd4b87e11; >= 963d0b3569354230f6e2c36a286ef270a8901878, < fdfb47e85af1e11ec822c82739dde2dd8dff5115; >= 963d0b3569354230f6e2c36a286ef270a8901878, < 5801e65206b065b0b2af032f7f1eef222aa2fd83 |
| Linux | Linux | 5.16 |
References
Timeline
- Published
- Last Modified
- Status
- Deferred
Frequently Asked Questions
What is CVE-2025-40096?
How severe is CVE-2025-40096?
How do I fix CVE-2025-40096?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2025
- CVE-2025-40090In the Linux kernel, the following vulnerability has been re…5.5
- CVE-2025-40091In the Linux kernel, the following vulnerability has been re…
- CVE-2025-40092In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2025-40093In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2025-40094In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2025-40095In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2025-40097In the Linux kernel, the following vulnerability has been re…
- CVE-2025-40098In the Linux kernel, the following vulnerability has been re…
- CVE-2025-40099In the Linux kernel, the following vulnerability has been re…9.4
- CVE-2025-4010The Netcom NTC 6200 and NWL 222 series expose a web interfac…8.6
- CVE-2025-40100In the Linux kernel, the following vulnerability has been re…
- CVE-2025-40101In the Linux kernel, the following vulnerability has been re…
Are you affected by CVE-2025-40096?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
