aboutsummaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-02-06 16:39:44 -0500
committerIngo Molnar <mingo@elte.hu>2008-02-06 16:39:44 -0500
commit32a932332c8bad842804842eaf9651ad6268e637 (patch)
tree58f187409029f089f788c5c35ad5c200b4a555af /fs/binfmt_elf.c
parent4cc6028d4040f95cdb590a87db478b42b8be0508 (diff)
brk randomization: introduce CONFIG_COMPAT_BRK
based on similar patch from: Pavel Machek <pavel@ucw.cz> Introduce CONFIG_COMPAT_BRK. If disabled then the kernel is free (but not obliged to) randomize the brk area. Heap randomization breaks ancient binaries, so we keep COMPAT_BRK enabled by default. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 4628c42ca892..111771d38e6e 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1077,7 +1077,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
1077 current->mm->start_stack = bprm->p; 1077 current->mm->start_stack = bprm->p;
1078 1078
1079#ifdef arch_randomize_brk 1079#ifdef arch_randomize_brk
1080 if (current->flags & PF_RANDOMIZE) 1080 if ((current->flags & PF_RANDOMIZE) && (randomize_va_space > 1))
1081 current->mm->brk = current->mm->start_brk = 1081 current->mm->brk = current->mm->start_brk =
1082 arch_randomize_brk(current->mm); 1082 arch_randomize_brk(current->mm);
1083#endif 1083#endif