diff options
author | Chuck Ebbert <76306.1226@compuserve.com> | 2006-06-26 07:59:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 13:48:22 -0400 |
commit | 03fdc2c277afdbd217eccd1ce0cfeff77ebd8b77 (patch) | |
tree | e7264520754eed7b71296c839dff36d9270ee516 | |
parent | 6bfa9bb5195c68f75bd3937e4d77cb0bfe852d0d (diff) |
[PATCH] x86_64: enlarge window for stack growth
Allow stack growth so the 'enter' instruction works. Also
fixes problem in compat_sys_kexec_load() which could allocate
more than 128 bytes using compat_alloc_user_space().
Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/x86_64/mm/fault.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c index 64728898f869..4968a71df4aa 100644 --- a/arch/x86_64/mm/fault.c +++ b/arch/x86_64/mm/fault.c | |||
@@ -410,8 +410,10 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, | |||
410 | if (!(vma->vm_flags & VM_GROWSDOWN)) | 410 | if (!(vma->vm_flags & VM_GROWSDOWN)) |
411 | goto bad_area; | 411 | goto bad_area; |
412 | if (error_code & 4) { | 412 | if (error_code & 4) { |
413 | // XXX: align red zone size with ABI | 413 | /* Allow userspace just enough access below the stack pointer |
414 | if (address + 128 < regs->rsp) | 414 | * to let the 'enter' instruction work. |
415 | */ | ||
416 | if (address + 65536 + 32 * sizeof(unsigned long) < regs->rsp) | ||
415 | goto bad_area; | 417 | goto bad_area; |
416 | } | 418 | } |
417 | if (expand_stack(vma, address)) | 419 | if (expand_stack(vma, address)) |