[PATCH 2/2] mm/huge_memory: Mark moved huge zero page PMD as special
From: Chris Down
Date: Tue Feb 17 2026 - 22:46:11 EST
Without pmd_mkspecial(), vm_normal_page_pmd() on architectures with
CONFIG_ARCH_HAS_PTE_SPECIAL does not recognise the moved huge zero page
as special, incorrectly treating it as a normal page and corrupting its
refcount.
Fixes: d82d09e48219 ("mm/huge_memory: mark PMD mappings of the huge zero folio special")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Chris Down <chris@xxxxxxxxxxxxxx>
---
mm/huge_memory.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index fed57951a7cd..5f908cdb11f1 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2795,6 +2795,7 @@ int move_pages_huge_pmd(struct mm_struct *mm, pmd_t *dst_pmd, pmd_t *src_pmd, pm
} else {
src_pmdval = pmdp_huge_clear_flush(src_vma, src_addr, src_pmd);
_dst_pmd = folio_mk_pmd(page_folio(src_page), dst_vma->vm_page_prot);
+ _dst_pmd = pmd_mkspecial(_dst_pmd);
}
set_pmd_at(mm, dst_addr, dst_pmd, _dst_pmd);
--
2.51.2