aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/fault.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r--arch/x86/mm/fault.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 033292dc9e21..65709a6aa6ee 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -26,6 +26,7 @@
26#include <linux/kprobes.h> 26#include <linux/kprobes.h>
27#include <linux/uaccess.h> 27#include <linux/uaccess.h>
28#include <linux/kdebug.h> 28#include <linux/kdebug.h>
29#include <linux/magic.h>
29 30
30#include <asm/system.h> 31#include <asm/system.h>
31#include <asm/desc.h> 32#include <asm/desc.h>
@@ -433,6 +434,8 @@ static noinline void no_context(struct pt_regs *regs,
433 unsigned long error_code, unsigned long address) 434 unsigned long error_code, unsigned long address)
434{ 435{
435 struct task_struct *tsk = current; 436 struct task_struct *tsk = current;
437 unsigned long *stackend;
438
436#ifdef CONFIG_X86_64 439#ifdef CONFIG_X86_64
437 unsigned long flags; 440 unsigned long flags;
438 int sig; 441 int sig;
@@ -469,6 +472,10 @@ static noinline void no_context(struct pt_regs *regs,
469 472
470 show_fault_oops(regs, error_code, address); 473 show_fault_oops(regs, error_code, address);
471 474
475 stackend = end_of_stack(tsk);
476 if (*stackend != STACK_END_MAGIC)
477 printk(KERN_ALERT "Thread overran stack, or stack corrupted\n");
478
472 tsk->thread.cr2 = address; 479 tsk->thread.cr2 = address;
473 tsk->thread.trap_no = 14; 480 tsk->thread.trap_no = 14;
474 tsk->thread.error_code = error_code; 481 tsk->thread.error_code = error_code;