CVE-2025-40096
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.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
No mitigations published for this CVE yet.
The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or โ if you've already worked around this in production โ publish your fix to the community-verified tier.
โ Propose a mitigation on Community โ Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here withsource_tier=community-verified.
OS impact
SUSE Affected 1 release
| Version | Status | Fixed in |
|---|---|---|
| โ | Affected | โ |
AlmaLinux Fixed 1 release
| Version | Status | Fixed in |
|---|---|---|
| 9 | Fixed | kernel-devel-5.14.0-611.45.1.el9_7.aarch64.rpm |
Debian Fixed 5 releases
| Version | Status | Fixed in |
|---|---|---|
| trixie | Fixed | 6.12.57-1 |
| sid | Fixed | 6.17.6-1 |
| forky | Fixed | 6.17.6-1 |
| bullseye | Fixed | 0 |
| bookworm | Fixed | 6.1.158-1 |
Red Hat Fixed 2 releases
| Version | Status | Fixed in |
|---|---|---|
| 9 | Fixed | โ |
| 8 | Fixed | โ |
Rocky Linux Fixed 2 releases
| Version | Status | Fixed in |
|---|---|---|
| 9 | Fixed | โ |
| 8 | Fixed | โ |
References
- https://errata.rockylinux.org/RLSA-2026:0760
- https://errata.rockylinux.org/RLSA-2026:0759
- https://access.redhat.com/errata/RHSA-2026:6153
- https://www.suse.com/security/cve/CVE-2025-40096.html
- https://errata.rockylinux.org/RLSA-2026:6153
- https://security-tracker.debian.org/tracker/CVE-2025-40096
- https://bugzilla.redhat.com/2376376
- https://bugzilla.redhat.com/2407333
- https://bugzilla.redhat.com/2439872
- https://bugzilla.redhat.com/2439886
- https://bugzilla.redhat.com/2439887
- https://bugzilla.redhat.com/2439900
- https://bugzilla.redhat.com/2439931
- https://bugzilla.redhat.com/2439947
- https://errata.almalinux.org/9/ALSA-2026-6153.html
- https://access.redhat.com/errata/RHSA-2026:0759
- https://bugzilla.redhat.com/2373329
- https://bugzilla.redhat.com/2401432
- https://bugzilla.redhat.com/2401514
- https://bugzilla.redhat.com/2422836
- https://errata.almalinux.org/8/ALSA-2026-0759.html
- https://access.redhat.com/errata/RHSA-2026:0760
- https://errata.almalinux.org/8/ALSA-2026-0760.html
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.