Messages in this thread | | | From | Jann Horn <> | Date | Fri, 12 Oct 2018 14:09:52 +0200 | Subject | Re: [PATCH] mm: don't clobber partially overlapping VMA with MAP_FIXED_NOREPLACE |
| |
On Fri, Oct 12, 2018 at 12:23 PM Michael Ellerman <mpe@ellerman.id.au> wrote: > Jann Horn <jannh@google.com> writes: > > On Wed, Oct 10, 2018 at 7:19 PM Michal Hocko <mhocko@suse.com> wrote: > >> On Wed 10-10-18 17:27:36, Jann Horn wrote: > >> > Daniel Micay reports that attempting to use MAP_FIXED_NOREPLACE in an > >> > application causes that application to randomly crash. The existing check > >> > for handling MAP_FIXED_NOREPLACE looks up the first VMA that either > >> > overlaps or follows the requested region, and then bails out if that VMA > >> > overlaps *the start* of the requested region. It does not bail out if the > >> > VMA only overlaps another part of the requested region. > >> > >> I do not understand. Could you give me an example? > > > > Sure. > > > > ======= > > user@debian:~$ cat mmap_fixed_simple.c > > #include <sys/mman.h> > > #include <errno.h> > > #include <stdio.h> > > #include <stdlib.h> > > #include <unistd.h> > > .. > > Mind if I turn that into a selftest?
Feel free to do that. :)
| |