Re: [PATCH v2] userfaultfd: allow registration of ranges below mmap_min_addr
From: Harry Yoo (Oracle)
Date: Thu Apr 09 2026 - 08:01:38 EST
On Thu, Apr 09, 2026 at 01:33:45PM +0300, Denis M. Karpov wrote:
> The current implementation of validate_range() in fs/userfaultfd.c
> performs a hard check against mmap_min_addr. This is redundant because
> UFFDIO_REGISTER operates on memory ranges that must already be backed
> by a VMA.
>
> Enforcing mmap_min_addr or capability checks again in userfaultfd is
> unnecessary and prevents applications like binary compilers from
> using UFFD for valid memory regions mapped by application.
>
> Remove the redundant check for mmap_min_addr.
>
> Fixes: 86039bd3b4e6 ("userfaultfd: add new syscall to provide memory externalization")
> Signed-off-by: Denis M. Karpov <komlomal@xxxxxxxxx>
> ---
> v2:
> - Remove the check entirely rather than replacing it, as suggested by
> Harry Yoo and Lorenzo Stoakes.
> - Added Fixes tag.
> - Link to v1: https://lore.kernel.org/r/20260407081442.6256-1-komlomal@xxxxxxxxx
> ---
Looks good to me,
Acked-by: Harry Yoo (Oracle) <harry@xxxxxxxxxx>
--
Cheers,
Harry / Hyeonggon