Re: [PATCH 10/10] mm/mremap: fix calling fixup_hugetlb_reservations() on the wrong VMA

From: David Hildenbrand (Arm)

Date: Mon Oct 19 2026 - 08:28:50 EST


On 10/18/26 10:34, Lance Yang wrote:
>
> On Thu, Oct 15, 2026 at 06:07:16PM +0200, David Hildenbrand (Arm) wrote:
>> In case we fail to move the page tables, for example, because we fail
>> to allocate a page table, we actually keep the old VMA.
>>
>> Calling fixup_hugetlb_reservations() on the old VMA is wrong. Fix it
>> by just calling it on the VMA that will be removed.
>>
>> The user-visible impact is that the VMA loses its reservations, meaning
>> that the existing reservations get stranded (leaked) and new hugetlb folios
>> that are getting allocated in the VMA cannot make use of the
>> reservations, failing these allocations.
>>
>> Fixes: b714ccb02a76 ("mm/mremap: complete refactor of move_vma()")
>> Cc: stable@xxxxxxxxxxxxxxx
>> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
>> Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
>> ---
>
> Reviewed-by: Lance Yang <lance.yang@xxxxxxxxx>

Thanks for all the review, Lance!

--
Cheers,

David