summaryrefslogtreecommitdiffstats
path: root/arch/i386/mm/fault.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/mm/fault.c')
-rw-r--r--arch/i386/mm/fault.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index b0404a6a9..e4847c070 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -161,23 +161,25 @@ good_area:
bad_area:
up(&mm->mmap_sem);
- /* Are we prepared to handle this fault? */
+ /* User mode accesses just cause a SIGSEGV */
+ if (error_code & 4) {
+ tsk->tss.cr2 = address;
+ tsk->tss.error_code = error_code;
+ tsk->tss.trap_no = 14;
+ force_sig(SIGSEGV, tsk);
+ goto out;
+ }
+
+ /* Are we prepared to handle this kernel fault? */
if ((fixup = search_exception_table(regs->eip)) != 0) {
printk(KERN_DEBUG "%s: Exception at [<%lx>] (%lx)\n",
- current->comm,
+ tsk->comm,
regs->eip,
fixup);
regs->eip = fixup;
goto out;
}
- if (error_code & 4) {
- tsk->tss.cr2 = address;
- tsk->tss.error_code = error_code;
- tsk->tss.trap_no = 14;
- force_sig(SIGSEGV, tsk);
- goto out;
- }
/*
* Oops. The kernel tried to access some bad page. We'll have to
* terminate things with extreme prejudice.