{"id":"CVE-2026-68266","state":"PUBLISHED","title":"drm/xe: Hold a dma-buf reference for imported BOs","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/xe: Hold a dma-buf reference for imported BOs\n\nAn imported dma-buf BO is created as a ttm_bo_type_sg BO whose\nreservation object is the exporter's dma_buf->resv. The importer,\nhowever, only takes a dma-buf reference after a successful\ndma_buf_dynamic_attach(). Until then nothing keeps the exporter alive,\nso if the exporter is freed while the BO still references its resv, a\nlater access to that resv is a use-after-free:\n\n  Oops: general protection fault, probably for non-canonical address\n        0x6b6b6b6b6b6b6b9c\n  Workqueue: ttm ttm_bo_delayed_delete [ttm]\n  RIP: 0010:mutex_can_spin_on_owner+0x3f/0xc0\n\nThis can be reached on two paths:\n\n - dma_buf_dynamic_attach() fails, or\n - ttm_bo_init_reserved() fails during BO creation.\n\nIn both cases the BO already has bo->base.resv pointing at the exporter\nresv, and sg BOs are always torn down via ttm_bo_delayed_delete(), which\nlocks bo->base.resv asynchronously - potentially after the exporter has\nbeen freed.\n\nTake the dma-buf reference in xe_bo_init_locked(), before\nttm_bo_init_reserved(), so it also covers a creation failure there, and\nrelease it in xe_ttm_bo_destroy(). The reference is held for the whole\nBO lifetime, keeping the shared resv alive on every path.\n\nv2:\n  - Reworked the fix to avoid creating the imported sg BO before\n    dma_buf_dynamic_attach() succeeds.\n  - Attach with importer_priv == NULL and make invalidate_mappings ignore\n    incomplete imports.\n\nv3:\n  - Dropped the xe-side reordering approach since importer_priv must be\n    valid when dma_buf_dynamic_attach() publishes the attachment.\n  - Per Christian's suggestion on the v1 thread, keyed the check on\n    import_attach rather than removing the sg guard entirely.\n  - Fixes both xe and amdgpu in a single TTM patch.\n\nv4:\n  - Moved import_attach check to after dma_resv_copy_fences() so fences\n    are copied before returning for successful imports (Thomas).\n  - Removed exporter-alive claim from commit message (Thomas).\n\nv5:\n  - Add drm/xe patch to keep imported sg BOs off the LRU before attach\n    succeeds; the TTM fix alone is not sufficient for xe if the BO is\n    already LRU-visible. (Thomas)\n    v4 patch:\n    https://patchwork.freedesktop.org/patch/736663/?series=169129&rev=2\n  - Patch 1 (drm/ttm) carries Christian's Reviewed-by from v4.\n\nv6:\n  - Reworked the fix based on Thomas' suggestion. Instead of the TTM resv\n    individualization (v1-v5) plus the xe off-LRU/placement handling (v5),\n    just hold a dma-buf reference for the imported BO lifetime so the\n    shared resv can never be freed while the BO still references it.\n    Single xe patch, no TTM change. (Thomas)\n  - Take the reference in xe_bo_init_locked() before ttm_bo_init_reserved()\n    so a TTM creation failure is covered too (Thomas).\n  - Dropped the v5 series (drm/ttm + drm/xe off-LRU); the off-LRU approach\n    also regressed in CI BAT via ttm_bo_pipeline_gutting() creating a ghost\n    BO that outlived the exporter.\n    Link to v5: https://patchwork.freedesktop.org/series/169984/\n\nv7:\n  - Move changelog above --- so it stays in the commit message.\n  - Reorder changelog entries oldest-to-newest. (Thomas)\n\n(cherry picked from commit 3516f3fae6be35642f8f06f8a218da6425c0306a)","publishedAt":"2026-08-10T12:01:41.280Z","updatedAt":"2026-10-19T20:58:58.924Z","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":"dd08ebf6c3525a7ea2186e636df064ea47281987","status":"affected","lessThan":"c22d65d62b3318e237c0e5b1177d90ab83d9fe06","versionType":"git"},{"version":"dd08ebf6c3525a7ea2186e636df064ea47281987","status":"affected","lessThan":"c1954c66662de477a8f4309335b775f7b07bd28b","versionType":"git"},{"version":"dd08ebf6c3525a7ea2186e636df064ea47281987","status":"affected","lessThan":"ba8c4cbb31c6f81fa5b12d6e28f1f706040aff48","versionType":"git"},{"version":"dd08ebf6c3525a7ea2186e636df064ea47281987","status":"affected","lessThan":"62775525a27c3b0d56382e08ba81ee2d322058b6","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/xe/xe_bo.c","drivers/gpu/drm/xe/xe_bo.h","drivers/gpu/drm/xe/xe_bo_types.h","drivers/gpu/drm/xe/xe_dma_buf.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.103","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.42","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.1.6","status":"unaffected","lessThanOrEqual":"7.1.*","versionType":"semver"},{"version":"7.2","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/xe/xe_bo.c","drivers/gpu/drm/xe/xe_bo.h","drivers/gpu/drm/xe/xe_bo_types.h","drivers/gpu/drm/xe/xe_dma_buf.c"]}],"references":["https://git.kernel.org/stable/c/c22d65d62b3318e237c0e5b1177d90ab83d9fe06","https://git.kernel.org/stable/c/c1954c66662de477a8f4309335b775f7b07bd28b","https://git.kernel.org/stable/c/ba8c4cbb31c6f81fa5b12d6e28f1f706040aff48","https://git.kernel.org/stable/c/62775525a27c3b0d56382e08ba81ee2d322058b6"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:12:49.727Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/68xxx/CVE-2026-68266.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-68266","state":"PUBLISHED","datePublished":"2026-08-10T12:01:41.280Z","dateUpdated":"2026-10-19T20:58:58.924Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-07-30T09:28:09.378Z"},"containers":{"cna":{"title":"drm/xe: Hold a dma-buf reference for imported BOs","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/xe: Hold a dma-buf reference for imported BOs\n\nAn imported dma-buf BO is created as a ttm_bo_type_sg BO whose\nreservation object is the exporter's dma_buf->resv. The importer,\nhowever, only takes a dma-buf reference after a successful\ndma_buf_dynamic_attach(). Until then nothing keeps the exporter alive,\nso if the exporter is freed while the BO still references its resv, a\nlater access to that resv is a use-after-free:\n\n  Oops: general protection fault, probably for non-canonical address\n        0x6b6b6b6b6b6b6b9c\n  Workqueue: ttm ttm_bo_delayed_delete [ttm]\n  RIP: 0010:mutex_can_spin_on_owner+0x3f/0xc0\n\nThis can be reached on two paths:\n\n - dma_buf_dynamic_attach() fails, or\n - ttm_bo_init_reserved() fails during BO creation.\n\nIn both cases the BO already has bo->base.resv pointing at the exporter\nresv, and sg BOs are always torn down via ttm_bo_delayed_delete(), which\nlocks bo->base.resv asynchronously - potentially after the exporter has\nbeen freed.\n\nTake the dma-buf reference in xe_bo_init_locked(), before\nttm_bo_init_reserved(), so it also covers a creation failure there, and\nrelease it in xe_ttm_bo_destroy(). The reference is held for the whole\nBO lifetime, keeping the shared resv alive on every path.\n\nv2:\n  - Reworked the fix to avoid creating the imported sg BO before\n    dma_buf_dynamic_attach() succeeds.\n  - Attach with importer_priv == NULL and make invalidate_mappings ignore\n    incomplete imports.\n\nv3:\n  - Dropped the xe-side reordering approach since importer_priv must be\n    valid when dma_buf_dynamic_attach() publishes the attachment.\n  - Per Christian's suggestion on the v1 thread, keyed the check on\n    import_attach rather than removing the sg guard entirely.\n  - Fixes both xe and amdgpu in a single TTM patch.\n\nv4:\n  - Moved import_attach check to after dma_resv_copy_fences() so fences\n    are copied before returning for successful imports (Thomas).\n  - Removed exporter-alive claim from commit message (Thomas).\n\nv5:\n  - Add drm/xe patch to keep imported sg BOs off the LRU before attach\n    succeeds; the TTM fix alone is not sufficient for xe if the BO is\n    already LRU-visible. (Thomas)\n    v4 patch:\n    https://patchwork.freedesktop.org/patch/736663/?series=169129&rev=2\n  - Patch 1 (drm/ttm) carries Christian's Reviewed-by from v4.\n\nv6:\n  - Reworked the fix based on Thomas' suggestion. Instead of the TTM resv\n    individualization (v1-v5) plus the xe off-LRU/placement handling (v5),\n    just hold a dma-buf reference for the imported BO lifetime so the\n    shared resv can never be freed while the BO still references it.\n    Single xe patch, no TTM change. (Thomas)\n  - Take the reference in xe_bo_init_locked() before ttm_bo_init_reserved()\n    so a TTM creation failure is covered too (Thomas).\n  - Dropped the v5 series (drm/ttm + drm/xe off-LRU); the off-LRU approach\n    also regressed in CI BAT via ttm_bo_pipeline_gutting() creating a ghost\n    BO that outlived the exporter.\n    Link to v5: https://patchwork.freedesktop.org/series/169984/\n\nv7:\n  - Move changelog above --- so it stays in the commit message.\n  - Reorder changelog entries oldest-to-newest. (Thomas)\n\n(cherry picked from commit 3516f3fae6be35642f8f06f8a218da6425c0306a)"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"dd08ebf6c3525a7ea2186e636df064ea47281987","status":"affected","lessThan":"c22d65d62b3318e237c0e5b1177d90ab83d9fe06","versionType":"git"},{"version":"dd08ebf6c3525a7ea2186e636df064ea47281987","status":"affected","lessThan":"c1954c66662de477a8f4309335b775f7b07bd28b","versionType":"git"},{"version":"dd08ebf6c3525a7ea2186e636df064ea47281987","status":"affected","lessThan":"ba8c4cbb31c6f81fa5b12d6e28f1f706040aff48","versionType":"git"},{"version":"dd08ebf6c3525a7ea2186e636df064ea47281987","status":"affected","lessThan":"62775525a27c3b0d56382e08ba81ee2d322058b6","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/xe/xe_bo.c","drivers/gpu/drm/xe/xe_bo.h","drivers/gpu/drm/xe/xe_bo_types.h","drivers/gpu/drm/xe/xe_dma_buf.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.103","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.42","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.1.6","status":"unaffected","lessThanOrEqual":"7.1.*","versionType":"semver"},{"version":"7.2","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/xe/xe_bo.c","drivers/gpu/drm/xe/xe_bo.h","drivers/gpu/drm/xe/xe_bo_types.h","drivers/gpu/drm/xe/xe_dma_buf.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/c22d65d62b3318e237c0e5b1177d90ab83d9fe06"},{"url":"https://git.kernel.org/stable/c/c1954c66662de477a8f4309335b775f7b07bd28b"},{"url":"https://git.kernel.org/stable/c/ba8c4cbb31c6f81fa5b12d6e28f1f706040aff48"},{"url":"https://git.kernel.org/stable/c/62775525a27c3b0d56382e08ba81ee2d322058b6"}],"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 through DRM_IOCTL_PRIME_FD_TO_HANDLE on an Intel xe DRM render node (/dev/dri/renderD*), which requires local access to the device file; there is no remote or network-facing path into xe_gem_prime_import().\nAC:L - The attacker fully controls both halves: they pick an exporter whose attach fails deterministically (drm_gem_map_attach() returns -ENOSYS, xe_dma_buf_attach() returns -EOPNOTSUPP for non-p2p cross-device imports) or induce the -ENOMEM paths, then simply close the dma-buf fd while the sg BO teardown is still queued on the TTM workqueue. No condition outside their control is needed.\nPR:L - DRM_IOCTL_PRIME_FD_TO_HANDLE is marked DRM_RENDER_ALLOW, so any unprivileged local user holding the normally world/group-accessible render node (any GUI user on a distro, any app on Android/ChromeOS) can perform the import; no capabilities are checked.\nUI:N - The entire sequence — export a dma-buf, import it into xe, close the fd — is performed by the attacker's own process; no victim action or cooperation is required.\nS:U - The use-after-free occurs on kernel heap memory within the same kernel security authority; there is no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - The freed dma_buf/dma_resv is a slab object the attacker can reclaim with sprayed content before ttm_bo_delayed_delete() dereferences it, so the stale bo->base.resv can be aimed at attacker-chosen kernel addresses and the resulting ww_mutex/fence walks leaked back, giving arbitrary kernel memory disclosure.\nI:H - dma_resv_lock()/dma_resv_unlock() and the subsequent ttm_bo_cleanup_memtype_use() perform writes and list manipulation through the dangling pointer into reclaimed heap memory, so the UAF yields a controllable write primitive usable for control-flow hijacking and privilege escalation.\nA:H - Even unexploited, the flaw reliably produces a kernel oops — the reported general protection fault on poisoned memory in mutex_can_spin_on_owner() from the ttm workqueue — which is a fatal fault in kernel worker context and takes down the GPU stack or the whole machine."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-17T05:01:59.066Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.12.103"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.18.42"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"7.1.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"7.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2026-68266","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2026-10-16T15:46:26.487807Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-19T20:58:58.924Z"}}]}}}