]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/binfmt_elf.c
binfmt_elf: Do not move brk for INTERP-less ET_EXEC
[mirror_ubuntu-bionic-kernel.git] / fs / binfmt_elf.c
index 9b9338bb2bd90bba6e64dca5679954128a64e47b..0272426d31f457b967b8ce9fce6ecb4170b10c3d 100644 (file)
@@ -1132,7 +1132,8 @@ static int load_elf_binary(struct linux_binprm *bprm)
                 * (since it grows up, and may collide early with the stack
                 * growing down), and into the unused ELF_ET_DYN_BASE region.
                 */
-               if (IS_ENABLED(CONFIG_ARCH_HAS_ELF_RANDOMIZE) && !interpreter)
+               if (IS_ENABLED(CONFIG_ARCH_HAS_ELF_RANDOMIZE) &&
+                   loc->elf_ex.e_type == ET_DYN && !interpreter)
                        current->mm->brk = current->mm->start_brk =
                                ELF_ET_DYN_BASE;