Re: [PATCH] userfaultfd: fix remap event with MREMAP_DONTUNMAP.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 6, 2020 at 9:11 PM Brian Geffon <bgeffon@xxxxxxxxxx> wrote:
>
> > > -       mremap_userfaultfd_complete(&uf, addr, new_addr, old_len);
> > > +       mremap_userfaultfd_complete(&uf, addr, ret, old_len);
> >
> > Not super familiar with this code, but thought I'd ask, does ret
> > to be checked for -ENOMEM before calling mremap_userfaultfd_complete?
> > Sorry if I missed something.
>
> No, mremap_userfaultfd_complete will do a check similar to
> offset_in_page() by checking the page mask.
> It does (to & ~PAGE_MASK) to check for a non-aligned "to" value, so we're good.
>
> Additionally, earlier in the process then ctx will be null because we
> will have never called mremap_userfaultfd_prep,
> and mremap_userfaultfd_complete will check if there is a context
> before proceeding.

Makes sense.

thanks,

 - Joel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux