CVE-2026-46215: drm: Set old handle to NULL before prime swap in change_handle
In the Linux kernel, the following vulnerability has been resolved:
drm: Set old handle to NULL before prime swap in changehandle
There was a potential race condition in changehandle. The ioctl briefly had a single object with two idr entries; a concurrent gemclose could delete the object and remove one of the handles while leaving the other one dangling, which could subsequently be dereferenced for a use-after-free.
To fix this, do the same dance that gemclose itself does. (f6cd7daecff5 drm: Release driver references to handle before making it available again) First idrreplace the old handle to NULL. Later, if the prime operations are successful, actually close it.
createtail required a similar dance to avoid a similar problem. (bd46cece51a3 drm/gem: Fix race in drmgemhandlecreatetail()) It idrallocs the new handle with NULL, then swaps in the correct object later to avoid races. We don't need to do that here, since the only operations that could race are drmprime, and changehandle holds the prime lock for the entire duration.
v2: cleanups of error paths
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch bd46cece51a3 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch f6cd7daecff5 - Configuration
In DRM GEM handle change/create_tail logic, implement the race fix by first idr_replace the old handle to NULL, idr_alloc the new handle with NULL then swap in the correct handle, and keep the object/handle updates consistent with the 'dance' used by gem_close (including v2 cleanup of error paths) to prevent use-after-free via concurrent drm_prime.
Linux kernel DRM GEM (drm_gem) change_handle / create_tail handle lifecycle = Set old handle to NULL (idr_replace old handle -> NULL) before prime swap; idr_alloc new handle with NULL then swap correct pointer; use same 'dance' as gem_close; v2 cleanup of error paths
Event History
Frequently Asked Questions
What is the severity of CVE-2026-46215?
The severity of CVE-2026-46215 is high with a score of 7.8.
How do I fix CVE-2026-46215?
To fix CVE-2026-46215, update your Linux kernel to the latest version where this vulnerability has been patched.
What type of vulnerability is CVE-2026-46215?
CVE-2026-46215 is classified as a Use After Free and Race Condition vulnerability.
What impacts does CVE-2026-46215 have on the system?
CVE-2026-46215 can potentially allow an attacker to exploit race conditions leading to system instability or unauthorized access.
Which component is affected by CVE-2026-46215?
CVE-2026-46215 affects the Linux kernel's DRM subsystem.