Skip to content

Commit

Permalink
[PATCH] x86_64: enlarge window for stack growth
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Chuck Ebbert authored and Linus Torvalds committed Jun 26, 2006
1 parent 6bfa9bb commit 03fdc2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/x86_64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,10 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
if (!(vma->vm_flags & VM_GROWSDOWN))
goto bad_area;
if (error_code & 4) {
// XXX: align red zone size with ABI
if (address + 128 < regs->rsp)
/* Allow userspace just enough access below the stack pointer
* to let the 'enter' instruction work.
*/
if (address + 65536 + 32 * sizeof(unsigned long) < regs->rsp)
goto bad_area;
}
if (expand_stack(vma, address))
Expand Down

0 comments on commit 03fdc2c

Please sign in to comment.