{"id":"CVE-2026-46215","state":"PUBLISHED","title":"drm: Set old handle to NULL before prime swap in change_handle","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm: Set old handle to NULL before prime swap in change_handle\n\nThere was a potential race condition in change_handle. The ioctl\nbriefly had a single object with two idr entries; a concurrent\ngem_close could delete the object and remove one of the handles\nwhile leaving the other one dangling, which could subsequently\nbe dereferenced for a use-after-free.\n\nTo fix this, do the same dance that gem_close itself does.\n(f6cd7daecff5 drm: Release driver references to handle before making it available again)\nFirst idr_replace the old handle to NULL. Later, if the prime\noperations are successful, actually close it.\n\ncreate_tail required a similar dance to avoid a similar problem.\n(bd46cece51a3 drm/gem: Fix race in drm_gem_handle_create_tail())\nIt idr_allocs the new handle with NULL, then swaps in the correct\nobject later to avoid races. We don't need to do that here, since\nthe only operations that could race are drm_prime, and\nchange_handle holds the prime lock for the entire duration.\n\nv2: cleanups of error paths","publishedAt":"2026-05-28T09:40:32.050Z","updatedAt":"2026-08-05T12:30:33.895Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"53096728b8910c6916ecc6c46a5abc5c678b58d9","status":"affected","lessThan":"672464dd53231509c9c771110798c56d4660e19e","versionType":"git"},{"version":"53096728b8910c6916ecc6c46a5abc5c678b58d9","status":"affected","lessThan":"61bd96d3e5472c253f9c1ab77608f0c8aaa9d025","versionType":"git"},{"version":"53096728b8910c6916ecc6c46a5abc5c678b58d9","status":"affected","lessThan":"5e28b7b94408897e41c63477aabc9e1db439bc8c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/drm_gem.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.18","versionType":"semver"},{"version":"6.18.32","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.0.9","status":"unaffected","lessThanOrEqual":"7.0.*","versionType":"semver"},{"version":"7.1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/drm_gem.c"]}],"references":["https://git.kernel.org/stable/c/672464dd53231509c9c771110798c56d4660e19e","https://git.kernel.org/stable/c/61bd96d3e5472c253f9c1ab77608f0c8aaa9d025","https://git.kernel.org/stable/c/5e28b7b94408897e41c63477aabc9e1db439bc8c","https://github.com/0xCyberstan/CVE-2026-46215-POC"],"weaknesses":[],"ingestedAt":"2026-10-29T20:12:07.131Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/46xxx/CVE-2026-46215.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-46215","state":"PUBLISHED","datePublished":"2026-05-28T09:40:32.050Z","dateUpdated":"2026-08-05T12:30:33.895Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-05-13T15:03:33.105Z"},"containers":{"cna":{"title":"drm: Set old handle to NULL before prime swap in change_handle","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm: Set old handle to NULL before prime swap in change_handle\n\nThere was a potential race condition in change_handle. The ioctl\nbriefly had a single object with two idr entries; a concurrent\ngem_close could delete the object and remove one of the handles\nwhile leaving the other one dangling, which could subsequently\nbe dereferenced for a use-after-free.\n\nTo fix this, do the same dance that gem_close itself does.\n(f6cd7daecff5 drm: Release driver references to handle before making it available again)\nFirst idr_replace the old handle to NULL. Later, if the prime\noperations are successful, actually close it.\n\ncreate_tail required a similar dance to avoid a similar problem.\n(bd46cece51a3 drm/gem: Fix race in drm_gem_handle_create_tail())\nIt idr_allocs the new handle with NULL, then swaps in the correct\nobject later to avoid races. We don't need to do that here, since\nthe only operations that could race are drm_prime, and\nchange_handle holds the prime lock for the entire duration.\n\nv2: cleanups of error paths"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"53096728b8910c6916ecc6c46a5abc5c678b58d9","status":"affected","lessThan":"672464dd53231509c9c771110798c56d4660e19e","versionType":"git"},{"version":"53096728b8910c6916ecc6c46a5abc5c678b58d9","status":"affected","lessThan":"61bd96d3e5472c253f9c1ab77608f0c8aaa9d025","versionType":"git"},{"version":"53096728b8910c6916ecc6c46a5abc5c678b58d9","status":"affected","lessThan":"5e28b7b94408897e41c63477aabc9e1db439bc8c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/drm_gem.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.18","versionType":"semver"},{"version":"6.18.32","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.0.9","status":"unaffected","lessThanOrEqual":"7.0.*","versionType":"semver"},{"version":"7.1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/drm_gem.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/672464dd53231509c9c771110798c56d4660e19e"},{"url":"https://git.kernel.org/stable/c/61bd96d3e5472c253f9c1ab77608f0c8aaa9d025"},{"url":"https://git.kernel.org/stable/c/5e28b7b94408897e41c63477aabc9e1db439bc8c"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The bug is reached only via the DRM_IOCTL_GEM_CHANGE_HANDLE ioctl on a local DRM device node (/dev/dri/renderD* or card*); there is no network or remote path to this code.\nAC:L - This is a race condition where the attacker controls both racing threads (one issuing GEM_CHANGE_HANDLE, another GEM_CLOSE on the same fd) and can retry the ioctls indefinitely, so the window is reliably winnable.\nPR:L - The ioctl is flagged DRM_RENDER_ALLOW with no DRM_AUTH/DRM_MASTER/DRM_ROOT_ONLY and no capability check, so any unprivileged local user with access to a DRM render node (standard on desktops/Android/kiosks) can trigger it.\nUI:N - The attacker drives the entire exploit through its own ioctls; no action by another user or victim is required.\nS:U - The use-after-free corrupts kernel heap memory within the same kernel security authority; it does not cross a VM/hypervisor or IOMMU boundary.\nC:H - A use-after-free on a heap-allocated drm_gem_object lets the attacker reclaim the freed slot with controlled data and read back object contents/pointers, enabling kernel memory disclosure.\nI:H - The dangling idr entry is dereferenced (kref_get write, plus obj->funcs->* calls), and a reclaimed UAF object gives heap-spray-based arbitrary write and control-flow hijacking primitives.\nA:H - Dereferencing the freed/dangling GEM object reliably causes kernel oops/panic, a full denial of service."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:30:33.895Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"6.18.32"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"7.0.9"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"7.1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/0xCyberstan/CVE-2026-46215-POC","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-07-09T00:00:00+00:00","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3","id":"CVE-2026-46215"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-07-10T03:55:46.719Z"}}]}}}