CVE-2026-89967 PUBLISHED

mm/migrate_device: avoid out-of-bounds writes for compound folios

Assigner: Linux
Reserved: 11.09.2026 Published: 16.09.2026 Updated: 16.09.2026

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

mm/migrate_device: avoid out-of-bounds writes for compound folios

migrate_device_range() and migrate_device_pfns() clear the entries following a compound folio so that the PFN arrays retain their page-granular representation.

If a compound folio extends beyond the end of the caller-provided range, the loops clear all following folio entries without limiting them to the number of slots remaining in the npages-sized array, causing an out-of-bounds write.

Do not proceed with a compound folio if its page-granular representation does not fit entirely in the remaining PFN array. If this happens, drop any reference and lock acquired for the folio, clear the remaining entries, and stop collecting.

Observed with a KASAN x86 QEMU kernel using the HMM migrate_anon_huge_zero selftest. Closing /dev/hmm_dmirror0 after migrating an anonymous huge page to device memory exercises:

dmirror_fops_release() -> dmirror_device_evict_chunk() -> migrate_device_range()

Metrics

CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 7.8

AV:L - The OOB write is in migrate_device_range()/migrate_device_pfns() on the device-private eviction path, reached from local HMM/GPU SVM (close of /dev/hmm_dmirror, Nouveau dmem teardown, Intel Xe drm_pagemap_evict_to_ram after DRM_XE_VM_BIND), not from received network packets. AC:L - The attacker creates a compound device folio by migrating an anonymous THP or huge-zero page, then triggers eviction of a too-small PFN array (dmirror close/HMM_DMIRROR_RELEASE or Xe TTM eviction of a CPU_ADDR_MIRROR BO). The HMM selftest hits this deterministically; no victim timing is required. PR:L - Intel Xe DRM_XE_VM_BIND is DRM_RENDER_ALLOW with no capable() or DRM-master check. An unprivileged local user with typical render/video-group access to /dev/dri/renderD can migrate a THP to device memory and force drm_pagemap_evict_to_ram. UI:N - The attacker performs mmap/madvise, the migrate ioctl, and eviction or close entirely in their own process. No other user or administrator needs to mount a filesystem, open a file, or otherwise interact. S:U - The overflow corrupts host-kernel memory adjacent to the caller-provided src_pfns kvcalloc/kvmalloc array. That is standard local privilege escalation in the same security authority, not a KVM/Xen guest-to-host escape or IOMMU/DMA bypass. C:H - migrate_device_* zeros every tail slot of a compound folio without clipping to npages, overflowing the PFN array by up to (folio_nr_pages-remaining) pointers (~4KB for a 2MB THP). That heap corruption can be turned into an arbitrary kernel read via overlapping objects. I:H - The same unbounded store is an out-of-bounds kernel write into adjacent slab/vmalloc objects. Zeroing neighboring heap metadata, pointers, or function pointers is exploitable for an arbitrary write and control-flow hijack, not a bounded integrity change. A:H - KASAN reports this overflow on the HMM migrate_anon_huge_zero selftest when closing /dev/hmm_dmirror0, and smashing adjacent kernel objects with zeros causes an oops or panic even without a completed exploit.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from a30b48bf1b244f11bf9b6d20cdccfe0c2264130c to 99186b185c245f5987d7f8715d5504c8d8cc04a0 (excl.)
  • affected from a30b48bf1b244f11bf9b6d20cdccfe0c2264130c to dc41e961a269f2ca4196e669d6d8e05480899cd4 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 6.19 is affected
  • unaffected from 0 to 6.19 (excl.)
  • unaffected from 7.2.5 to 7.2.* (incl.)
  • unaffected from 7.3-rc2 to * (incl.)

References