Re: [PATCH] mm/huge_memory: check VMA end bounds in insert_pmd() and insert_pud()

From: David Hildenbrand (Arm)

Date: Wed Nov 25 2026 - 17:40:47 EST


On 11/25/26 23:19, Elkin Cruz wrote:
> insert_pmd() and insert_pud() only check that addr lies within
> [vma->vm_start, vma->vm_end) without verifying that the full PMD or PUD
> mapping fits below vma->vm_end. On a VMA whose end is not PMD- or
> PUD-aligned, inserting a huge mapping at the tail straddles past
> vma->vm_end.
>
> Require vma->vm_end - addr >= HPAGE_PMD_SIZE in insert_pmd() and
> vma->vm_end - addr >= HPAGE_PUD_SIZE in insert_pud().
>
> Fixes: 5cad465d7fa6 ("mm: add vmf_insert_pfn_pmd()")
> Fixes: a00cc7d9dd93 ("mm, x86: add support for PUD-sized transparent hugepages")

Which users in the tree trigger this?

--
Cheers,

David