lkml.org 
[lkml]   [2018]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map
On Wed 30-05-18 17:51:15, Mike Kravetz wrote:
[...]
> [ 38.931497] load_elf_binary: skipping index 0 p_vaddr = 8048034
> [ 38.932321] load_elf_binary: skipping index 1 p_vaddr = 8048154
> [ 38.933165] load_elf_binary: calling elf_map() index 2 bias 0 vaddr 8048000
> [ 38.934087] map_addr ELF_PAGESTART(addr) 8048000 total_size 0 ELF_PAGEALIGN(size) 2000
> [ 38.935101] eppnt->p_offset = 0
> [ 38.935561] eppnt->p_vaddr = 8048000
> [ 38.936073] eppnt->p_paddr = 8048000
> [ 38.936897] eppnt->p_filesz = 169c
> [ 38.937493] eppnt->p_memsz = 169c
> [ 38.938042] load_elf_binary: calling elf_map() index 3 bias 0 vaddr 804969c
> [ 38.939002] map_addr ELF_PAGESTART(addr) 8049000 total_size 0 ELF_PAGEALIGN(size) 2000
> [ 38.939959] eppnt->p_offset = 169c
> [ 38.940410] eppnt->p_vaddr = 804969c
> [ 38.940897] eppnt->p_paddr = 804969c
> [ 38.941507] eppnt->p_filesz = 1878
> [ 38.942019] eppnt->p_memsz = 1878
> [ 38.942516] 1123 (xB.linkhuge_nof): Uhuuh, elf segment at 8049000 requested but the memory is mapped already
>
> It is pretty easy to see the mmap conflict. I'm still trying to determine if
> the executable file is 'valid'. It did not throw an error previously as
> MAP_FIXED unmapped the overlapping page. However, this does not seem right.

Yes, it looks suspicious to say the least. How come the original content
is not needed anymore? Maybe the first section should be 0x1000 rather
than 0x169c?

I am not an expert on the load linkers myself so I cannot really answer
this question. Please note that ppc had something similar. See
ad55eac74f20 ("elf: enforce MAP_FIXED on overlaying elf segments").
Maybe we need to sprinkle more of those at other places?
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2018-05-31 11:25    [W:0.066 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site