Skip to content

fs, elf: get rid of MAP_FIXED from the loader

Michal Hocko linux-metag lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 20 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2fs, elf: drop MAP_FIXED usage from elf_mapfs/binfmt_elf.c+26 -311 replies
2/2fs, elf: drop MAP_FIXED from initial ET_DYN segmentfs/binfmt_elf.c+0 -19 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] fs, elf: get rid of MAP_FIXED from the loader

Hi,
the previous discussion didn't really show any hard requirement for MAP_FIXED usage for the elf segments mapping. I have spent some more time studying the code (thanks to Qualys for their insight) and concluded that the current MAP_FIXED usage is rather fragile and not really needed. The first patch replaces it by a hint mmaping and failing rather than silently corrupt an existing memory and the second patch removes MAP_FIXED for the initial segment mapping because this shouldn't be really needed either, I would even call it wrong.
Anyway, more details are in the changelog of patches. I will really appreciate any feedback.

This has passed some testing with PIE/PIC binaries running in the loop without any negative side effects detected.