Re: [PATCH v2] kselftest: mm: fix potential failure for merged VMA in guard-regions

From: David Hildenbrand (Arm)

Date: Fri Sep 11 2026 - 11:22:24 EST


On 9/11/26 16:29, Yeoreum Yun wrote:
> check_vmflag_guard() uses /proc/self/smaps to retrieve the VMA flags,
> but this can fail if the mapping is merged with an adjacent VMA.
>
> To avoid this potential failure, first allocate a temporary region with
> extra pages at both ends, unmap it, and then map the test region within
> the temporary address range, leaving an unmapped page on each side to
> prevent VMA merging.
>
> Signed-off-by: Yeoreum Yun <yeoreum.yun@xxxxxxx>
> ---

Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

--
Cheers,

David