CVE-2026-31397: mm/huge_memory: fix use of NULL folio in move_pages_huge_pmd()
In the Linux kernel, the following vulnerability has been resolved:
mm/huge_memory: fix use of NULL folio in move_pages_huge_pmd()
move_pages_huge_pmd() handles UFFDIO_MOVE for both normal THPs and huge
zero pages. For the huge zero page path, src_folio is explicitly set to
NULL, and is used as a sentinel to skip folio operations like lock and
rmap.
In the huge zero page branch, src_folio is NULL, so folio_mk_pmd(NULL,
pgprot) passes NULL through folio_pfn() and page_to_pfn(). With
SPARSEMEM_VMEMMAP this silently produces a bogus PFN, installing a PMD
pointing to non-existent physical memory. On other memory models it is a
NULL dereference.
Use page_folio(src_page) to obtain the valid huge zero folio from the
page, which was obtained from pmd_page() and remains valid throughout.
After commit d82d09e48219 ("mm/huge_memory: mark PMD mappings of the huge
zero folio special"), moved huge zero PMDs must remain special so
vm_normal_page_pmd() continues to treat them as special mappings.
move_pages_huge_pmd() currently reconstructs the destination PMD in the
huge zero page branch, which drops PMD state such as pmd_special() on
architectures with CONFIG_ARCH_HAS_PTE_SPECIAL. As a result,
vm_normal_page_pmd() can treat the moved huge zero PMD as a normal page
and corrupt its refcount.
Instead of reconstructing the PMD from the folio, derive the destination
entry from src_pmdval after pmdp_huge_clear_flush(), then handle the PMD
metadata the same way move_huge_pmd() does for moved entries by marking it
soft-dirty and clearing uffd-wp.
Security readout for executives and security teams
Plain-English summary
A flaw in affected Linux kernels can mishandle huge zero-page memory during UFFDIO_MOVE operations. A local, low-privileged user may trigger invalid memory mappings, a NULL dereference, or page-refcount corruption, potentially compromising confidentiality, integrity, and availability. Network-only attackers are not directly exposed by the documented vector.
Executive priority
Treat as a high-priority kernel update for shared, multi-user, development, hosting, and container-worker systems. Internet exposure alone does not satisfy the documented attack vector, but local tenant or account access materially increases urgency. Follow normal emergency-change safeguards because kernel updates require reboot and operational validation.
Technical view
move_pages_huge_pmd() incorrectly handles a NULL src_folio and can construct a destination PMD with a bogus physical frame number or dereference NULL. It may also drop pmd_special() state, causing vm_normal_page_pmd() to misclassify the huge zero-page mapping and corrupt its reference count. The linked stable commits preserve the source PMD state and use a valid folio.
Likely exposure
Exposure is limited to Linux systems running an affected kernel where a local, low-privileged process can reach the vulnerable UFFDIO_MOVE huge-page path. The supplied record identifies affected versions including 6.16, 6.18.20, 6.19.10, and 7.0, but administrators should confirm exact distribution backports with their vendor.
Exploitation context
The CVSS vector is local, low complexity, low privilege, and requires no user interaction. Potential impact spans confidentiality, integrity, and availability. The record is not in KEV, and the supplied sources provide no evidence of active exploitation or a public exploit.
Researcher notes
The defect has two related failure modes: NULL-folio use can yield a bogus PFN or NULL dereference depending on the memory model, while reconstructing the PMD can lose special-entry metadata and corrupt the huge zero-page refcount. The bundle does not identify a CWE, confirmed exploit, or precise distribution package boundaries.
Mitigation direction
Apply a vendor-supported kernel containing the applicable linked stable fix.
Check distribution advisories for exact fixed package versions and backport status.
Prioritize multi-user systems that execute untrusted or tenant-controlled local workloads.
Reboot into the corrected kernel after installation.
Validation and detection
Record the running kernel version on every potentially affected Linux host.
Confirm the installed kernel contains the applicable stable fix or vendor backport.
Verify systems rebooted successfully into the corrected kernel.
Review kernel logs for unexplained memory faults or crashes; these are indicators, not proof of exploitation.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2026-31397 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
4Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.