]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/x86/mm/fault.c
Merge branch 'x86/mm' into core/percpu
[mv-sheeva.git] / arch / x86 / mm / fault.c
index 033292dc9e214d96b28ff6154bca2af366b4b711..65709a6aa6ee046dab8e3368075a371cd4e2a6a0 100644 (file)
@@ -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>
@@ -433,6 +434,8 @@ static noinline void no_context(struct pt_regs *regs,
                        unsigned long error_code, unsigned long address)
 {
        struct task_struct *tsk = current;
+       unsigned long *stackend;
+
 #ifdef CONFIG_X86_64
        unsigned long flags;
        int sig;
@@ -469,6 +472,10 @@ static noinline void no_context(struct pt_regs *regs,
 
        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;