diff options
author | Andi Kleen <ak@suse.de> | 2006-05-30 16:47:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-30 23:31:05 -0400 |
commit | 6ae53cd496d36db5f25e6f84b8b9fe7e675999a1 (patch) | |
tree | 298b1b2c498c5d8e95954809b9bd3890a92ac0fb /arch | |
parent | 3793c65c13e4751c7a10f98198bae1758453eb0e (diff) |
[PATCH] x86_64: Fix stack/mmap randomization for compat tasks
ia32_setup_arg_pages would ignore the passed in random stack top
and use its own static value.
Now it uses the 8bit of randomness native i386 would use too.
This indirectly fixes mmap randomization for 32bit processes too,
which depends on the stack randomization.
Should also give slightly better virtual cache colouring and
possibly better performance with HyperThreading.
Signed-off-by: Andi Kleen <ak@suse.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86_64/ia32/ia32_binfmt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c index e776139afb20..926c4743d13b 100644 --- a/arch/x86_64/ia32/ia32_binfmt.c +++ b/arch/x86_64/ia32/ia32_binfmt.c | |||
@@ -339,7 +339,7 @@ int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, | |||
339 | struct mm_struct *mm = current->mm; | 339 | struct mm_struct *mm = current->mm; |
340 | int i, ret; | 340 | int i, ret; |
341 | 341 | ||
342 | stack_base = IA32_STACK_TOP - MAX_ARG_PAGES * PAGE_SIZE; | 342 | stack_base = stack_top - MAX_ARG_PAGES * PAGE_SIZE; |
343 | mm->arg_start = bprm->p + stack_base; | 343 | mm->arg_start = bprm->p + stack_base; |
344 | 344 | ||
345 | bprm->p += stack_base; | 345 | bprm->p += stack_base; |
@@ -357,7 +357,7 @@ int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, | |||
357 | { | 357 | { |
358 | mpnt->vm_mm = mm; | 358 | mpnt->vm_mm = mm; |
359 | mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p; | 359 | mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p; |
360 | mpnt->vm_end = IA32_STACK_TOP; | 360 | mpnt->vm_end = stack_top; |
361 | if (executable_stack == EXSTACK_ENABLE_X) | 361 | if (executable_stack == EXSTACK_ENABLE_X) |
362 | mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC; | 362 | mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC; |
363 | else if (executable_stack == EXSTACK_DISABLE_X) | 363 | else if (executable_stack == EXSTACK_DISABLE_X) |