CVE-2026-142877: mm/huge_memory: set the mmu_gather page size in zap_huge_pud()
In the Linux kernel, the following vulnerability has been resolved:
mm/hugememory: set the mmugather page size in zaphugepud()
Unmapping a device-dax mapping with 1G alignment on powerpc radix kernel built with CONFIGDEBUGVM triggers this warning on every munmap:
WARNING: mm/mmugather.c:176 at tlbremovefoliopagessize+0x38/0x230 NIP [c00000000063d508] tlbremovefoliopagessize+0x38/0x230 LR [c0000000006fb688] zaphugepud+0x1b8/0x2d0 Call Trace: zaphugepud+0x170/0x2d0 (unreliable) zapvmarange+0x1604/0x1e20 unmapvmas+0xa0/0x1f0 unmapregion+0xb0/0x130 vmscompletemunmapvmas+0x120/0x310 dovmialignmunmap+0x1ec/0x240 vmmunmap+0x148/0x220 sysmunmap+0x28/0x40
To trigger this - it is enough to mmap() /dev/dax0.0, touch the first byte so that the whole 1G is mapped by a single PUD and then munmap() it.
PowerPC needs MMUGATHERPAGESIZE in which mmugather needs to record the page size for which tlb flush is needed. zaphugepmd(), zappterange(), changehugepud() etc all do this already. However, since commit: dbe54153296d ("mm/hugememory: add vmfinsertfoliopud()")
a device-dax PUD maps a real folio and zaphugepud() now hands it to tlbremovepagesize(tlb, page, HPAGEPUDSIZE). At that point tlb->pagesize is still whatever the previous user left behind, which is 0 for the fresh gather set up by munmap() and so the check fires.
Fix this in the same way like how other similar paths do.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5