From e308faf24f68e262d92d294a01ddca7a17e76762 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 20 Jul 1997 14:56:40 +0000 Subject: Sync with Linux 2.1.46. --- arch/i386/mm/fault.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'arch/i386/mm') 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. -- cgit v1.2.3