Messages in this thread | | | From | Michael Ellerman <> | Subject | Re: [PATCH] mm: don't clobber partially overlapping VMA with MAP_FIXED_NOREPLACE | Date | Fri, 12 Oct 2018 21:23:21 +1100 |
| |
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?
cheers
| |