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

Next file: linux/arch/m68k/amiga/amiints.c
Previous file: linux/arch/i386/lib/delay.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.124/linux/arch/i386/mm/fault.c linux/arch/i386/mm/fault.c
@@ -103,8 +103,13 @@
 
 	tsk = current;
 	mm = tsk->mm;
-	if (in_interrupt())
-		die("page fault from irq handler",regs,error_code);
+
+	/*
+	 * If we're in an interrupt or have no user
+	 * context, we must not take the fault..
+	 */
+	if (in_interrupt() || mm == &init_mm)
+		goto no_context;
 
 	down(&mm->mmap_sem);
 
@@ -194,6 +199,7 @@
 		}
 	}
 
+no_context:
 	/* Are we prepared to handle this kernel fault?  */
 	if ((fixup = search_exception_table(regs->eip)) != 0) {
 		regs->eip = fixup;
@@ -235,8 +241,6 @@
 		page = ((unsigned long *) __va(page))[address >> PAGE_SHIFT];
 		printk(KERN_ALERT "*pte = %08lx\n", page);
 	}
-	lock_kernel();
 	die("Oops", regs, error_code);
 	do_exit(SIGKILL);
-	unlock_kernel();
 }

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