Skip to contentSkip to conversation

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

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 16

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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()

The Linux kernel CVE team has assigned CVE-2026-89967 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.19 with commit a30b48bf1b244f11bf9b6d20cdccfe0c2264130c and fixed in 7.2.5 with commit 99186b185c245f5987d7f8715d5504c8d8cc04a0
	Issue introduced in 6.19 with commit a30b48bf1b244f11bf9b6d20cdccfe0c2264130c and fixed in 7.3-rc2 with commit dc41e961a269f2ca4196e669d6d8e05480899cd4

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-89967

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
mm/migrate_device.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/99186b185c245f5987d7f8715d5504c8d8cc04a0
	https://git.kernel.org/stable/c/dc41e961a269f2ca4196e669d6d8e05480899cd4