Skip to content

Commit aeb7923

Browse files
akpm00torvalds
authored andcommitted
revert "fs/binfmt_elf: use PT_LOAD p_align values for static PIE"
Despite Mike's attempted fix (925346c), regressions reports continue: https://lore.kernel.org/lkml/[email protected]/ https://bugzilla.kernel.org/show_bug.cgi?id=215720 https://lkml.kernel.org/r/[email protected] So revert this patch. Fixes: 9630f0d ("fs/binfmt_elf: use PT_LOAD p_align values for static PIE") Cc: Alexey Dobriyan <[email protected]> Cc: Al Viro <[email protected]> Cc: Chris Kennelly <[email protected]> Cc: David Rientjes <[email protected]> Cc: Fangrui Song <[email protected]> Cc: H.J. Lu <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Nick Desaulniers <[email protected]> Cc: Sandeep Patil <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Song Liu <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: Thorsten Leemhuis <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 354e923 commit aeb7923

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/binfmt_elf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,11 +1117,11 @@ static int load_elf_binary(struct linux_binprm *bprm)
11171117
* independently randomized mmap region (0 load_bias
11181118
* without MAP_FIXED nor MAP_FIXED_NOREPLACE).
11191119
*/
1120-
alignment = maximum_alignment(elf_phdata, elf_ex->e_phnum);
1121-
if (alignment > ELF_MIN_ALIGN) {
1120+
if (interpreter) {
11221121
load_bias = ELF_ET_DYN_BASE;
11231122
if (current->flags & PF_RANDOMIZE)
11241123
load_bias += arch_mmap_rnd();
1124+
alignment = maximum_alignment(elf_phdata, elf_ex->e_phnum);
11251125
if (alignment)
11261126
load_bias &= ~(alignment - 1);
11271127
elf_flags |= MAP_FIXED_NOREPLACE;

0 commit comments

Comments
 (0)