X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Fx86%2Fmm%2Ffault.c;h=d18ea136d8a67567aabf8a0a9434ab0976fb2e89;hb=b2aaf8f74cdc84a9182f6cabf198b7763bcb9d40;hp=a742d753d5b0ae438a65e976354556a8b0c938b1;hpb=accba5f3965d6a9d1bf7c1e1a7995d17e9d521b6;p=pandora-kernel.git diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index a742d753d5b0..d18ea136d8a6 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -588,15 +589,12 @@ 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; #endif - /* - * We can fault from pretty much anywhere, with unknown IRQ state. - */ - trace_hardirqs_fixup(); - tsk = current; mm = tsk->mm; prefetchw(&mm->mmap_sem); @@ -855,6 +853,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;