Re: [PATCH v2] binfmt_elf: Use ELF_ET_DYN_BASE only for PIE

2017-07-04 Thread Michal Hocko
[Sorry for a late reply] On Tue 27-06-17 13:08:39, Kees Cook wrote: > On Tue, Jun 27, 2017 at 7:49 AM, Michal Hocko wrote: > > On Wed 21-06-17 10:32:01, Kees Cook wrote: > >> The ELF_ET_DYN_BASE position was originally intended to keep loaders > >> away from ET_EXEC binaries. (For example, runnin

Re: [PATCH v2] binfmt_elf: Use ELF_ET_DYN_BASE only for PIE

2017-06-27 Thread Kees Cook
On Tue, Jun 27, 2017 at 7:49 AM, Michal Hocko wrote: > On Wed 21-06-17 10:32:01, Kees Cook wrote: >> The ELF_ET_DYN_BASE position was originally intended to keep loaders >> away from ET_EXEC binaries. (For example, running "/lib/ld-linux.so.2 >> /bin/cat" might cause the subsequent load of /bin/ca

Re: [PATCH v2] binfmt_elf: Use ELF_ET_DYN_BASE only for PIE

2017-06-27 Thread Daniel Micay
On Tue, 2017-06-27 at 16:49 +0200, Michal Hocko wrote: > On Wed 21-06-17 10:32:01, Kees Cook wrote: > > The ELF_ET_DYN_BASE position was originally intended to keep loaders > > away from ET_EXEC binaries. (For example, running "/lib/ld- > > linux.so.2 > > /bin/cat" might cause the subsequent load o

Re: [PATCH v2] binfmt_elf: Use ELF_ET_DYN_BASE only for PIE

2017-06-27 Thread Michal Hocko
On Wed 21-06-17 10:32:01, Kees Cook wrote: > The ELF_ET_DYN_BASE position was originally intended to keep loaders > away from ET_EXEC binaries. (For example, running "/lib/ld-linux.so.2 > /bin/cat" might cause the subsequent load of /bin/cat into where the > loader had been loaded.) With the advent

Re: [PATCH v2] binfmt_elf: Use ELF_ET_DYN_BASE only for PIE

2017-06-21 Thread Rik van Riel
On Wed, 2017-06-21 at 10:32 -0700, Kees Cook wrote: > To allow for a lower ELF_ET_DYN_BASE, loaders (ET_DYN without INTERP) > are loaded into the mmap region, leaving space available for either > an > ET_EXEC binary with a fixed location or PIE being loaded into mmap by > the > loader. Only PIE pr