{"id":"CVE-2026-142877","summary":"mm/huge_memory: set the mmu_gather page size in zap_huge_pud()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/huge_memory: set the mmu_gather page size in zap_huge_pud()\n\nUnmapping a device-dax mapping with 1G alignment on powerpc radix kernel\nbuilt with CONFIG_DEBUG_VM triggers this warning on every munmap:\n\n    WARNING: mm/mmu_gather.c:176 at __tlb_remove_folio_pages_size+0x38/0x230\n    NIP [c00000000063d508] __tlb_remove_folio_pages_size+0x38/0x230\n    LR [c0000000006fb688] zap_huge_pud+0x1b8/0x2d0\n    Call Trace:\n     zap_huge_pud+0x170/0x2d0 (unreliable)\n     __zap_vma_range+0x1604/0x1e20\n     unmap_vmas+0xa0/0x1f0\n     unmap_region+0xb0/0x130\n     vms_complete_munmap_vmas+0x120/0x310\n     do_vmi_align_munmap+0x1ec/0x240\n     __vm_munmap+0x148/0x220\n     sys_munmap+0x28/0x40\n\nTo trigger this - it is enough to mmap() /dev/dax0.0, touch the first\nbyte so that the whole 1G is mapped by a single PUD and then munmap()\nit.\n\nPowerPC needs MMU_GATHER_PAGE_SIZE in which mmu_gather needs to record\nthe page size for which tlb flush is needed. zap_huge_pmd(),\nzap_pte_range(), change_huge_pud() etc all do this already. However,\nsince commit:\n  dbe54153296d (\"mm/huge_memory: add vmf_insert_folio_pud()\")\n\na device-dax PUD maps a real folio and zap_huge_pud() now hands it to\ntlb_remove_page_size(tlb, page, HPAGE_PUD_SIZE). At that point\ntlb-\u003epage_size is still whatever the previous user left behind, which is\n0 for the fresh gather set up by munmap() and so the check fires.\n\nFix this in the same way like how other similar paths do.","modified":"2026-12-03T05:01:04.576444412Z","published":"2026-12-03T03:23:34.889Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142877.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/466d6844c8f19fba16b668b49861bdb8d7ded282"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ac4c149cc0732a33e9d211d5ee9a49aac7878c57"},{"type":"WEB","url":"https://git.kernel.org/stable/c/bfd0c1c711660dd5c090a57f1aced2af262a679c"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142877.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142877"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"dbe54153296d0931144a63295fc9367794bbe797"},{"fixed":"ac4c149cc0732a33e9d211d5ee9a49aac7878c57"},{"fixed":"bfd0c1c711660dd5c090a57f1aced2af262a679c"},{"fixed":"466d6844c8f19fba16b668b49861bdb8d7ded282"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142877.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.15.0"},{"fixed":"6.18.64"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.5"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142877.json"}}],"schema_version":"1.9.2"}