Linux hwe edge: In the Linux kernel, the following vulnerability has been resolved: drm/sched: Fix potential double free in drm_sched_job_add_resv_dependencies When… (CVE-2025-40096)
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.
AI Analysis
Technical Summary
The Linux kernel's DRM scheduler had a long-standing double free vulnerability in drm_sched_job_add_resv_dependencies due to incorrect reference counting when adding dependencies via drm_sched_job_add_dependency(). On failure, the function consumes the fence reference twice, leading to a double free condition. This bug originated from the initial commit adding dependency tracking and persisted through multiple code revisions until it was fixed after commit 9c2ba265352a and subsequent patches. The fix involved correcting the reference management and improving code comments to clarify the reasoning behind reference handling.
Potential Impact
The double free vulnerability can cause memory corruption, which may be exploited to compromise system confidentiality, integrity, and availability. The CVSS vector indicates local attack complexity and privileges required, with no user interaction needed, and rates the impact on confidentiality, integrity, and availability as high.
Mitigation Recommendations
A fix for this vulnerability has been implemented in the Linux kernel. Users and administrators should update to the latest kernel version containing the fix. Since this is not a cloud service, remediation requires applying the official kernel patches or upgrading to a fixed kernel release. Patch status is not explicitly confirmed in the provided data; therefore, check the official Linux kernel advisories or vendor sources for the exact fixed versions and update accordingly.
Linux hwe edge: In the Linux kernel, the following vulnerability has been resolved: drm/sched: Fix potential double free in drm_sched_job_add_resv_dependencies When… (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.
CVSS v3.1
Score 7.8high
Affected software
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Linux kernel's DRM scheduler had a long-standing double free vulnerability in drm_sched_job_add_resv_dependencies due to incorrect reference counting when adding dependencies via drm_sched_job_add_dependency(). On failure, the function consumes the fence reference twice, leading to a double free condition. This bug originated from the initial commit adding dependency tracking and persisted through multiple code revisions until it was fixed after commit 9c2ba265352a and subsequent patches. The fix involved correcting the reference management and improving code comments to clarify the reasoning behind reference handling.
Potential Impact
The double free vulnerability can cause memory corruption, which may be exploited to compromise system confidentiality, integrity, and availability. The CVSS vector indicates local attack complexity and privileges required, with no user interaction needed, and rates the impact on confidentiality, integrity, and availability as high.
Mitigation Recommendations
A fix for this vulnerability has been implemented in the Linux kernel. Users and administrators should update to the latest kernel version containing the fix. Since this is not a cloud service, remediation requires applying the official kernel patches or upgrading to a fixed kernel release. Patch status is not explicitly confirmed in the provided data; therefore, check the official Linux kernel advisories or vendor sources for the exact fixed versions and update accordingly.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-xpm8-g6rj-74pw
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-40096"]
- Ecosystems
- []
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a6b72d69c2644c7f847ac0d
Added to database: 07/30/2026, 15:50:46 UTC
Last enriched: 07/30/2026, 16:38:00 UTC
Last updated: 07/31/2026, 19:22:55 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.