diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-19 12:36:09 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-19 12:36:09 +0100 |
commit | 7890ba8c87604ca4c2c73f7de846bf5305d743e4 (patch) | |
tree | f3f920c09b8de694b1bc1d4b878cfd2b0b98c913 /arch/x86/mm/fault.c | |
parent | 99937d6455cea95405ac681c86a857d0fcd530bd (diff) | |
parent | b2b062b8163391c42b3219d466ca1ac9742b9c7b (diff) |
Merge branch 'stackprotector' into core/percpu
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 90dfae511a4..37242c405f1 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; @@ -841,6 +844,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; |