{"id":"CVE-2026-89755","state":"PUBLISHED","title":"mm/migrate_device: clear stale mapping after freeing swapcache","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/migrate_device: clear stale mapping after freeing swapcache\n\n__migrate_device_pages() reads the folio mapping before calling\nfolio_free_swap().  When folio_free_swap() succeeds, the folio is removed\nfrom the swap cache, but the saved mapping still points to swap_space.\n\nPassing the stale mapping to folio_migrate_mapping() makes it use the\nmapped-folio path for a folio that is no longer in swapcache.  It can then\noperate on swap_space.i_pages with invalid reference accounting,\neventually triggering a folio reference count BUG.\n\nAfter a successful split, nr still contains the number of pages in the\noriginal large folio, although each resulting page is now a separate\norder-0 folio.  Reset nr to 1 so each split folio is processed separately,\nincluding its own swapcache removal and mapping lookup.\n\nRefresh the saved mapping after folio_free_swap() so the current folio\nstate is used during migration.","publishedAt":"2026-09-11T19:46:58.295Z","updatedAt":"2026-10-21T12:48:34.692Z","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":"df263d9a7dffee94ca5391120ee3b0587efa07f1","status":"affected","lessThan":"92db780dd644590c751246187e1229d5ac2e5544","versionType":"git"},{"version":"df263d9a7dffee94ca5391120ee3b0587efa07f1","status":"affected","lessThan":"4fa91f7bbc4135240b67daac03fc17d9e180a331","versionType":"git"},{"version":"df263d9a7dffee94ca5391120ee3b0587efa07f1","status":"affected","lessThan":"8ffedc6573a665cdc31ebe47eae7b32b78d0df83","versionType":"git"},{"version":"df263d9a7dffee94ca5391120ee3b0587efa07f1","status":"affected","lessThan":"34a00895d032a414830d41106a09329ae6c251b6","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/migrate_device.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.6","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.111","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"7.2.4","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/migrate_device.c"]}],"references":["https://git.kernel.org/stable/c/92db780dd644590c751246187e1229d5ac2e5544","https://git.kernel.org/stable/c/4fa91f7bbc4135240b67daac03fc17d9e180a331","https://git.kernel.org/stable/c/8ffedc6573a665cdc31ebe47eae7b32b78d0df83","https://git.kernel.org/stable/c/34a00895d032a414830d41106a09329ae6c251b6"],"weaknesses":[],"ingestedAt":"2026-10-29T20:13:26.108Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/89xxx/CVE-2026-89755.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-89755","state":"PUBLISHED","datePublished":"2026-09-11T19:46:58.295Z","dateUpdated":"2026-10-21T12:48:34.692Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-11T19:38:34.763Z"},"containers":{"cna":{"title":"mm/migrate_device: clear stale mapping after freeing swapcache","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/migrate_device: clear stale mapping after freeing swapcache\n\n__migrate_device_pages() reads the folio mapping before calling\nfolio_free_swap().  When folio_free_swap() succeeds, the folio is removed\nfrom the swap cache, but the saved mapping still points to swap_space.\n\nPassing the stale mapping to folio_migrate_mapping() makes it use the\nmapped-folio path for a folio that is no longer in swapcache.  It can then\noperate on swap_space.i_pages with invalid reference accounting,\neventually triggering a folio reference count BUG.\n\nAfter a successful split, nr still contains the number of pages in the\noriginal large folio, although each resulting page is now a separate\norder-0 folio.  Reset nr to 1 so each split folio is processed separately,\nincluding its own swapcache removal and mapping lookup.\n\nRefresh the saved mapping after folio_free_swap() so the current folio\nstate is used during migration."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"df263d9a7dffee94ca5391120ee3b0587efa07f1","status":"affected","lessThan":"92db780dd644590c751246187e1229d5ac2e5544","versionType":"git"},{"version":"df263d9a7dffee94ca5391120ee3b0587efa07f1","status":"affected","lessThan":"4fa91f7bbc4135240b67daac03fc17d9e180a331","versionType":"git"},{"version":"df263d9a7dffee94ca5391120ee3b0587efa07f1","status":"affected","lessThan":"8ffedc6573a665cdc31ebe47eae7b32b78d0df83","versionType":"git"},{"version":"df263d9a7dffee94ca5391120ee3b0587efa07f1","status":"affected","lessThan":"34a00895d032a414830d41106a09329ae6c251b6","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/migrate_device.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.6","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.111","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"7.2.4","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/migrate_device.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/92db780dd644590c751246187e1229d5ac2e5544"},{"url":"https://git.kernel.org/stable/c/4fa91f7bbc4135240b67daac03fc17d9e180a331"},{"url":"https://git.kernel.org/stable/c/8ffedc6573a665cdc31ebe47eae7b32b78d0df83"},{"url":"https://git.kernel.org/stable/c/34a00895d032a414830d41106a09329ae6c251b6"}],"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 in __migrate_device_pages() on the migrate-to-device path (migrate_vma_pages), reached from local GPU HMM/SVM ioctls such as AMDKFD_IOC_SVM, DRM_NOUVEAU_SVM_BIND (DRM_RENDER_ALLOW), and Intel Xe drm_pagemap_migrate_to_devmem, not from network packets.\nAC:L - The attacker controls both preconditions: anonymous pages in their VMA, optionally kept in swapcache via pageout/swapin, then a migrate-to-VRAM ioctl. folio_free_swap() succeeds on locked mapped swapcache folios with swap count 0, which the attacker can arrange; no victim timing or uncontrollable layout is required.\nPR:L - Nouveau SVM bind is DRM_RENDER_ALLOW and KFD SVM/Xe pagemap paths have no capable() or DRM-master check. An unprivileged local user with typical render/video-group access to /dev/dri/renderD* or /dev/kfd on GPU systems can trigger the migration.\nUI:N - The attacker drives the whole sequence in their own process (anonymous mmap, optional madvise pageout, and GPU SVM migrate-to-device ioctls). No action by another user or administrator is required.\nS:U - Impact is host-kernel swap-cache and folio-refcount corruption, i.e. standard local privilege escalation in the same security authority, not a KVM/Xen guest-to-host escape or IOMMU/DMA boundary bypass.\nC:H - After folio_free_swap() the stale mapping still points at swap_space, so folio_migrate_mapping() xas_store()s a device-private folio into the global swap cache and underflows the source refcount; that UAF/type confusion of swap_space.i_pages yields an arbitrary kernel read primitive.\nI:H - The same xarray insertion and refcount underflow corrupt shared MM metadata (swap cache and folio references), which is exploitable for heap reuse and arbitrary kernel writes or control-flow hijack, not a bounded integrity change.\nA:H - Invalid reference accounting on swap_space.i_pages is documented to hit a folio reference-count BUG, and the resulting underflow/UAF also causes kernel oops or panic even without a completed exploit."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-21T12:48:34.692Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.12.111"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"7.2.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"7.3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}