arm: move ELF_ET_DYN_BASE to 4MB

Now that explicitly executed loaders are loaded in the mmap region, we
have more freedom to decide where we position PIE binaries in the
address space to avoid possible collisions with mmap or stack regions.

4MB is chosen here mainly to have parity with x86, where this is the
traditional minimum load location, likely to avoid historically
requiring a 4MB page table entry when only a portion of the first 4MB
would be used (since the NULL address is avoided).

For ARM the position could be 0x8000, the standard ET_EXEC load address,
but that is needlessly close to the NULL address, and anyone running PIE
on 32-bit ARM will have an MMU, so the tight mapping is not needed.

Signed-off-by: Kees Cook <>
Cc: Russell King <>
Cc: Catalin Marinas <>
Cc: Will Deacon <>
Cc: Benjamin Herrenschmidt <>
Cc: Paul Mackerras <>
Cc: Michael Ellerman <>
Cc: Martin Schwidefsky <>
Cc: Heiko Carstens <>
Cc: James Hogan <>
Cc: Pratyush Anand <>
Cc: Ingo Molnar <>
Cc: "H. Peter Anvin" <>
Cc: Alexander Viro <>
Cc: Andy Lutomirski <>
Cc: Daniel Micay <>
Cc: Dmitry Safonov <>
Cc: Grzegorz Andrejczuk <>
Cc: Kees Cook <>
Cc: Masahiro Yamada <>
Cc: Qualys Security Advisory <>
Cc: Rik van Riel <>
Cc: Thomas Gleixner <>
Cc: <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
1 file changed