CVE-2026-138970: Linux kernel on MIPS maps hugetlb files at addresses that are not huge-page aligned and corrupts the page tables next door

ByLinuxtastic

December 3, 2026 #CVE, #Linux Kernel

Huge pages have to start on a huge-page boundary, and when the kernel picks the address for an mmap() of a hugetlbfs file it is supposed to make sure they do. The kernel CNA record describes the architecture that was left out: “Since hugetlb mappings were made to go through the architecture’s arch_get_unmapped_area{,_topdown}(), every architecture that implements those has to align hugetlb files itself. The generic implementation and loongarch do it with huge_page_mask_align(); MIPS was left out.” The result on an Octeon board, in the record’s words, is that “the neighbouring 4 KB page table is clobbered”, the TLB ends up with overlapping entries, process exit trips a BUG_ON, and “freed pages leak into unrelated kernel structures”. The kernel CNA and Red Hat score it 7.8 as a local flaw, Red Hat rates it Important. If a MIPS host runs a 6.13 or later kernel and anything uses hugetlbfs, upgrade it to a kernel at or above 6.18.63 or 7.3.4 and reboot.

CVE-2026-138970 at a glance.

ComponentLinux kernel on MIPS: arch_get_unmapped_area_common() in arch/mips/mm/mmap.c, the address search that mmap() uses when the caller does not pass MAP_FIXED
Affected versionsmainline 6.13 up to 7.4-rc1 (from commit 7bd3f1e1, “mm: make hugetlb mappings go through mm_get_unmapped_area_vmflags”); 6.18.x below 6.18.63, 7.3.x below 7.3.4. Kernels before 6.13 align hugetlb mappings in the generic code and are not affected; MIPS only
Fixed inmainline 7.4-rc1 (commit 975d4a6a, the one Debian cites) and stable 6.18.63, 7.3.4; three fix commits in the record. The fix does “what loongarch does”: when the file is a hugetlb file, the search aligns to its page mask instead of the cache-colour mask; five lines added, one removed, in arch/mips/mm/mmap.c
SeverityKernel CNA CVSS 3.1 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H), which NVD shows as its only metric; Red Hat Important, 7.8 on the same vector (score marked draft, CWE-787); Ubuntu Medium, no score. Local, unprivileged, and the record’s own description is of memory corruption rather than a clean crash
Exploited in the wildNot on the CISA KEV catalogue (2026.11.30). EPSS 0.00184 (8th percentile) on 1 December 2026
Who is exposedMIPS systems on a 6.13 or later kernel on which an unprivileged process can map a hugetlbfs file: the record’s reproducer is a process linked with libhugetlbfs on an Octeon CN63XX board, which corrupts memory “all within a minute of start” without trying to. Any user who can open a file on a hugetlbfs mount, or who has SHM_HUGETLB or MAP_HUGETLB available, can do what the reproducer does. Red Hat’s statement: “Red Hat Enterprise Linux does not support or build kernels for the MIPS hardware platform, preventing exploitation on supported enterprise installations”; every RHEL release is marked not affected on that basis
PublishedCVE record 30 November 2026 (kernel CNA, updated 1 December); this page built 2 December 2026, last updated 2 December 2026

What it is

Before 6.13 the memory manager had a separate address search for hugetlb files that aligned the result to the huge page size on every architecture. The 6.13 change routed those mappings through the same arch_get_unmapped_area() the architecture uses for everything else, with the understanding that each architecture would do the alignment itself. The generic implementation and LoongArch were updated; MIPS was not, so its search carried on aligning to SHMLBA, the cache-colouring granule, which is far smaller than a 2 MB huge page. The kernel then did what a hugetlb mapping asks for, installing PMD-sized entries, for a VMA that starts partway through a PMD.

The record lists what follows on real hardware, and none of it needs an attacker to be clever: the PMD entries overlap the 4 KB page table that covers the rest of that PMD, so that table is overwritten; the TLB holds entries that match the same address twice and the CPU raises a machine check; when the process exits, __unmap_hugepage_range() hits BUG_ON(start & ~huge_page_mask(h)); and the pages freed through the wrong table “leak into unrelated kernel structures”, with oopses in the IRQ maple tree and in pte_offset_map(). A process that does this deliberately chooses which page table its huge pages land on, which is the integrity impact in the 7.8; one that does it by accident, like the reproducer, takes the machine down.

The fix on GitHub, by Orgad Shaneh and committed by Thomas Bogendoerfer, is five lines in arch/mips/mm/mmap.c: if the file is a hugetlb file, use its page mask as the search alignment instead of the cache-colour mask, following the LoongArch commit the record cites. It is marked for stable from 6.13, and the Fixes: tag names the 6.13 commit that moved hugetlb mappings into the per-architecture path. git.kernel.org and lore.kernel.org refuse automated readers, so the backports are described from the record and the mainline commit from its GitHub mirror.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 1 and 2 December 2026; the link in the row is the tracker page, which will be newer than this one. Debian bookworm and trixie are on 6.1 and 6.12, before the change, and are not affected; the distributions that build MIPS kernels at all are few, and Red Hat is not one of them.

DistributionStatusFixed package
AlpineNot consulted for this page—
Debianbookworm (6.1.192-3) and trixie (6.12.118-1) not affected (“vulnerable code not present”); fixed in forky and sid (7.3.6-1); no DSAunstable 7.3.4-1; bookworm and trixie not affected
UbuntuMedium, no Ubuntu CVSS yet; linux needs evaluation in every supported release from 14.04 to 26.10 (no version named); no USNnothing released on 1 December 2026
RHEL, Rocky, Alma, CentOS StreamImportant, 7.8 (bug 2587015, “memory corruption via misaligned hugetlb mappings on MIPS”); every RHEL release from 6 to 10, kernel and kernel-rt, and every OpenShift image not affected: no MIPS kernelsnot applicable
openSUSE/SLENot consulted: suse.com refused the automated reader on 2 December 2026 (client error, twice)—
Fedora, Arch; self-built kernelsNot consulted; upstream stable versions apply6.18.63 / 7.3.4 or later, on MIPS only

How to check

Three questions, in order: is this a MIPS machine on a 6.13 or later kernel, is hugetlbfs mounted or are huge pages reserved, and can unprivileged users map them. The first question settles it for almost every reader; the record is MIPS only.

# 1. the architecture and the running kernel (6.13 or later on MIPS is in range below the fixed version)
uname -m -r

# 2. huge pages in use at all
grep -E 'HugePages_(Total|Free)|Hugepagesize' /proc/meminfo
grep hugetlbfs /proc/mounts
sysctl vm.nr_hugepages

# 3. the precondition: who can map them (group 0 means root only; -1 means anyone)
sysctl vm.hugetlb_shm_group
ls -ld /dev/hugepages 2>/dev/null
# the record's reproducer: a process using libhugetlbfs
ldconfig -p | grep -i libhugetlbfs

A machine that is not MIPS is not in the record, and a MIPS kernel below 6.13 or at or above the fixed version for its series is done. A MIPS 6.13+ host with huge pages reserved and a world-writable hugetlbfs mount, or vm.hugetlb_shm_group set to a group ordinary users belong to, is the record’s case; one where only root can map huge pages has removed the unprivileged attacker, though not the accidental crash. The log signatures are the record’s own: “Caught Machine Check exception – caused by multiple matching entries in the TLB” on an Octeon, or a BUG_ON in __unmap_hugepage_range().

How to fix it

Install the fixed kernel and reboot. Debian forky and sid had the fix out on 2 December; the MIPS boards that run these kernels usually take them from a vendor or a self-built tree, and the stable versions are the thing to track.

# Debian forky / sid on a MIPS port
apt update && apt install linux-image-$(dpkg --print-architecture) && systemctl reboot
# self-built: move to 6.18.63, 7.3.4 or later and rebuild
uname -r
# Until then: keep huge pages away from unprivileged users
sysctl -w vm.hugetlb_shm_group=0
mount -o remount,mode=0700 /dev/hugepages
# or reserve none at all
sysctl -w vm.nr_hugepages=0

Restricting huge pages to root removes the unprivileged attacker and is a real mitigation; reserving none removes the path entirely at the cost of whatever needed them. What not to do: do not apply the mitigation to a non-MIPS host on the strength of the 7.8; the alignment is done in the generic code everywhere else and the record says so. And do not assume a MIPS vendor kernel numbered 6.6 is safe because 6.6 is before 6.13: the question is whether it carries the 6.13 change, and the fix’s Cc: stable # 6.13+ says upstream believes none do.

Sources

  • CVE-2026-138970 at CVE.org — the kernel CNA record: the commit message with the “MIPS was left out” sentence and the Octeon symptoms, the git and version ranges, arch/mips/mm/mmap.c (30 November 2026, updated 1 December)
  • Fix commits on git.kernel.org: 975d4a6a (mainline, 7.4-rc1) and the backports b37f9d7d, 93ed028d; git.kernel.org refuses automated readers, so the mainline commit was read on GitHub: Orgad Shaneh, committed by Thomas Bogendoerfer, Fixes: 7bd3f1e1, Cc: stable # 6.13+, mmap.c +5/−1
  • NVD entry — Received on 30 November 2026; shows the CNA’s 7.8 as a secondary metric, no NVD score, CWE or CPE on 2 December
  • Distribution trackers: Debian (bookworm and trixie not affected, forky and sid fixed in 7.3.6-1) · Ubuntu (Medium; needs evaluation in every release) · Red Hat (Important 7.8, every RHEL release not affected (no MIPS); bug 2587015) · SUSE (not reachable on 2 December)
  • CISA KEV catalogue 2026.11.30, not listed · EPSS 0.00184 (percentile 0.084) on 1 December 2026

Related reading

This advisory page was assembled from the primary sources listed above on 2 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.