lkml.org 
[lkml]   [2017]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: MAP_FIXED for ELF mappings
On 10/04, Michal Hocko wrote:
>
> On Wed 04-10-17 23:12:38, Baoquan He wrote:
> > if (total_size) {
> > total_size = ELF_PAGEALIGN(total_size);
> > - map_addr = vm_mmap(filep, addr, total_size, prot, flags, off);
> > - if (!BAD_ADDR(map_addr))
> > - vm_munmap(map_addr+size, total_size-size);
> > - } else
> > - map_addr = vm_mmap(filep, addr, size, prot, flags, off);
> > + addr = get_unmapped_area(file, addr, total_size, off, flags);
>
> So how does this prevent clobbering an existing VMA when flags contains
> MAP_FIXED?

I got lost...

this is just cleanup, it should not change the behaviour, with or without
MAP_FIXED. It just avoids the mmap(total_size) + munmap(extra_size).

Oleg.

\
 
 \ /
  Last update: 2017-10-05 18:33    [W:0.377 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site