HIGH Introduced in 6.6
migrate_device Swapcache UAF
CVE-2026-89755
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.0HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: mm/migrate_device: clear stale mapping after freeing swapcache __migrate_device_pages() reads the folio mapping before calling folio_free_swap(). When folio_free_swap() succeeds, the folio is removed from the swap cache, but the saved mapping still points to swap_space. Passing the stale mapping to folio_migrate_mapping() makes it use the mapped-folio path for a folio that is no longer in swapcache. It can then operate on swap_space.i_pages with invalid reference accounting, eventually triggering a folio reference count BUG. After a successful split, nr still contains the number of pages in the original large folio, although each resulting page is now a separate order-0 folio. Reset nr to 1 so each split folio is processed separately, including its own swapcache removal and mapping lookup. Refresh the saved mapping after folio_free_swap() so the current folio state is used during migration.
02KernelScan AI Analysis
Risk summary
A local unprivileged user can trigger a use-after-free in the device page migration path when swapcache pages are involved. The stale mapping pointer leads to invalid reference accounting on swap space internal structures, potentially allowing memory corruption, privilege escalation, or kernel crashes.
Vulnerability analysis
During device page migration, the kernel saves a page's mapping information before removing it from the swap cache. If removal succeeds, the page is no longer in swap cache, but the saved mapping still points to the old swap-space structure. Migration then uses this stale pointer, corrupting reference counts on internal swap-space data. A second issue involves large page splitting: after a split, the loop continues with the wrong count, processing already-split pages with incorrect assumptions. The fix refreshes the mapping after swap-cache removal so migration uses current page state, and corrects the iteration count after a split so each resulting page is handled individually. This path is reachable locally by any process that can trigger device page migration with swapcache pages present.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 6.6 | 6.12.111 | 4fa91f7bbc41 |
| 6.6 | 6.6 | 6.6.160 | 92db780dd644 |
| 7.2 | 6.6 | 7.2.4 | 8ffedc6573a6 |
| mainline | 6.6 | 7.3 | 34a00895d032 |
| cip/6.12 | 6.6 | 6.12.111-cip32 | 4fa91f7bbc41 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.111-cip32 |