# CVE-2026-46215: drm: Set old handle to NULL before prime swap in change_handle

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.23%, higher than 14% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-05-28T09:40:32.050Z
- Modified: 2026-08-05T12:30:33.895Z
- Weaknesses: CWE-416
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

drm: Set old handle to NULL before prime swap in change_handle

There was a potential race condition in change_handle. The ioctl
briefly had a single object with two idr entries; a concurrent
gem_close 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 gem_close itself does.
(f6cd7daecff5 drm: Release driver references to handle before making it available again)
First idr_replace the old handle to NULL. Later, if the prime
operations are successful, actually close it.

create_tail required a similar dance to avoid a similar problem.
(bd46cece51a3 drm/gem: Fix race in drm_gem_handle_create_tail())
It idr_allocs 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 drm_prime, and
change_handle holds the prime lock for the entire duration.

v2: cleanups of error paths

(As written by CVE List.)

## Affected

- Linux Linux: from 53096728b8910c6916ecc6c46a5abc5c678b58d9 before 672464dd53231509c9c771110798c56d4660e19e; from 53096728b8910c6916ecc6c46a5abc5c678b58d9 before 61bd96d3e5472c253f9c1ab77608f0c8aaa9d025; from 53096728b8910c6916ecc6c46a5abc5c678b58d9 before 5e28b7b94408897e41c63477aabc9e1db439bc8c; 6.18 (not affected: before 6.18; from 6.18.32 up to 6.18.*; from 7.0.9 up to 7.0.*; from 7.1 up to *)
- linux linux_kernel: from 6.18 before 6.18.32; from 6.19 before 7.0.9; 7.1

## References

- <https://github.com/0xCyberstan/CVE-2026-46215-POC> (exploit)
- <https://git.kernel.org/stable/c/672464dd53231509c9c771110798c56d4660e19e> (patch)
- <https://git.kernel.org/stable/c/61bd96d3e5472c253f9c1ab77608f0c8aaa9d025> (patch)
- <https://git.kernel.org/stable/c/5e28b7b94408897e41c63477aabc9e1db439bc8c> (patch)

## Sources

- CVE List: [CVE-2026-46215](https://www.cve.org/CVERecord?id=CVE-2026-46215), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2026-46215](https://nvd.nist.gov/vuln/detail/CVE-2026-46215), Public domain, modified 2026-07-10

---

Page: https://cve.day/CVE-2026-46215 · Whole record: https://cve.day/CVE-2026-46215.json · Rebuilt by cve.day 2026-11-25T22:59:22.879Z
