patch-2.1.45 linux/arch/i386/mm/fault.c

Next file: linux/arch/sparc/Makefile
Previous file: linux/arch/i386/kernel/setup.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.44/linux/arch/i386/mm/fault.c linux/arch/i386/mm/fault.c
@@ -161,23 +161,25 @@
 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.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov