Skip to content

Commit be739f4

Browse files
kirylKAGA-KOKO
authored andcommitted
x86/mm: Fix ELF_ET_DYN_BASE for 5-level paging
On machines with 5-level paging we don't want to allocate mapping above 47-bit unless user explicitly asked for it. See b569bab ("x86/mm: Prepare to expose larger address space to userspace") for details. c715b72 ("mm: revert x86_64 and arm64 ELF_ET_DYN_BASE base changes") broke the behaviour. After the commit elf binary and heap got mapped above 47-bits. Use DEFAULT_MAP_WINDOW instead of TASK_SIZE to determine ELF_ET_DYN_BASE so it's forced to be below 47-bits unconditionally. Fixes: c715b72 ("mm: revert x86_64 and arm64 ELF_ET_DYN_BASE base changes") Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Kees Cook <keescook@chromium.org> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: linux-mm@kvack.org Cc: Andrew Morton <akpm@linux-foundation.org> Link: https://lkml.kernel.org/r/20171107103804.47341-1-kirill.shutemov@linux.intel.com
1 parent d0cd64b commit be739f4

File tree

1 file changed

+1
-1
lines changed
  • arch/x86/include/asm

1 file changed

+1
-1
lines changed

arch/x86/include/asm/elf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ extern int force_personality32;
253253
* space open for things that want to use the area for 32-bit pointers.
254254
*/
255255
#define ELF_ET_DYN_BASE (mmap_is_ia32() ? 0x000400000UL : \
256-
(TASK_SIZE / 3 * 2))
256+
(DEFAULT_MAP_WINDOW / 3 * 2))
257257

258258
/* This yields a mask that user programs can use to figure out what
259259
instruction set this CPU supports. This could be done in user space,

0 commit comments

Comments
 (0)