diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-12-01 11:38:06 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-12-01 11:38:06 +1100 |
commit | 3e96f3209a3ac6fae7152a668538247005c868a9 (patch) | |
tree | 35a9e88860ca9ffebc1ec621fc3af7b7c694d736 /arch/x86/mm/fault.c | |
parent | 465915ed7f163b6b60ddc1c51c9aa1dc9de853b6 (diff) | |
parent | 26136bb101dc26e30ebc93ca865cc16013415f67 (diff) |
Merge commit 'stackprotector/auto-stackprotector-next'
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 21e996a70d68..353a70d2fe71 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -26,6 +26,7 @@ #include <linux/kprobes.h> #include <linux/uaccess.h> #include <linux/kdebug.h> +#include <linux/magic.h> #include <asm/system.h> #include <asm/desc.h> @@ -589,6 +590,8 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code) unsigned long address; int write, si_code; int fault; + unsigned long *stackend; + #ifdef CONFIG_X86_64 unsigned long flags; int sig; @@ -842,6 +845,10 @@ no_context: show_fault_oops(regs, error_code, address); + stackend = end_of_stack(tsk); + if (*stackend != STACK_END_MAGIC) + printk(KERN_ALERT "Thread overran stack, or stack corrupted\n"); + tsk->thread.cr2 = address; tsk->thread.trap_no = 14; tsk->thread.error_code = error_code; |