linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] binfmt_elf: Clean up codes related to total_size passed into elf_map()
@ 2017-10-06  3:37 Baoquan He
  2017-10-06  3:37 ` [PATCH 1/3] binfmt_elf: Clean up the variable name of map flags Baoquan He
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Baoquan He @ 2017-10-06  3:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: viro, linux-fsdevel, oleg, mhocko, keescook, jkosina, mingo,
	torvalds, Baoquan He

Currently total_size passed into elf_map() is non-zero only for dynamic
loader, either in load_elf_interp(), or in load_elf_binary() for ET_DYN
without INTERP case. Now PIE programs are loaded offset from ELF_ET_DYN_BASE,
and map flags has been set as MAP_FIXED, no need to use tatal_size strategy.

And in elf_map(), Oleg pointed out that the mmap(total_size) + munmap(extra_size)
way looks very ugly. We can search the unmapped area of total_size big,
then only map the 1st PT_LOAD segment with the searched address.

In this patchset, clean up them all.

Baoquan He (3):
  binfmt_elf: Clean up the variable name of map flags
  binfmt_elf: Get the total_size only for dynamic loader in
    load_elf_binary()
  binfmt_elf: Search an unmapped area with total_size but not map the
    whole image

 fs/binfmt_elf.c | 50 +++++++++++++++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 23 deletions(-)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-07 12:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-06  3:37 [PATCH 0/3] binfmt_elf: Clean up codes related to total_size passed into elf_map() Baoquan He
2017-10-06  3:37 ` [PATCH 1/3] binfmt_elf: Clean up the variable name of map flags Baoquan He
2017-10-06  3:37 ` [PATCH 2/3] binfmt_elf: Get the total_size only for dynamic loader in load_elf_binary() Baoquan He
2017-10-06  3:37 ` [PATCH 3/3] binfmt_elf: Search an unmapped area with total_size but not map the whole image Baoquan He
2017-11-07 12:00 ` [PATCH 0/3] binfmt_elf: Clean up codes related to total_size passed into elf_map() Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).