Re: [PATCH v2] userfaultfd: allow registration of ranges below mmap_min_addr

Mike Rapoport
2026-04-09T15:17:43Z

On Thu, Apr 09, 2026 at 01:30:07PM +0100, Pedro Falcato wrote:
> 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@gmail.com>
>
> Reviewed-by: Pedro Falcato <pfalcato@suse.de>
>
> This looks relatively safe. However, I'm not sure if we want this in stable.
> This has been broken for 11 years now, with no complaints.

I believe Denis has a new usecase that wasn't there for those 11 years :)

Denis, can you share more details about your usecase for us to better
understand importance of backporting this to stable?

> --
> Pedro

--
Sincerely yours,
Mike.