All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] fix SEGV in handle_page_fault() when current->mm is NULL
@ 2007-05-24  9:29 Nicolas S. Dade
  2007-05-26 11:02 ` Blaisorblade
  2007-05-30 15:30 ` Jeff Dike
  0 siblings, 2 replies; 3+ messages in thread
From: Nicolas S. Dade @ 2007-05-24  9:29 UTC (permalink / raw)
  To: user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

In a non-uml kernel a get_user() when current->mm is NULL (kernel thread, or
userspace process being torn down) returns error. In uml it SEGVs. The bug is
that handle_page_fault() does not check for NULL before using mm. The
trivial attached patch fixes this.

-Nicolas Dade

[-- Attachment #2: fix.patch --]
[-- Type: text/plain, Size: 375 bytes --]

--- linux-2.6.21.2/arch/um/kernel/trap.c.orig	2007-05-24 02:22:42.000000000 -0700
+++ linux-2.6.21.2/arch/um/kernel/trap.c	2007-05-24 02:23:45.000000000 -0700
@@ -51,6 +51,9 @@
 	 * fail. */
 	if (in_atomic())
 		goto out_nosemaphore;
+	/* If we have no user-space just fail */
+	if (!mm)
+		goto out_nosemaphore;
 
 	down_read(&mm->mmap_sem);
 	vma = find_vma(mm, address);

[-- Attachment #3: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #4: Type: text/plain, Size: 194 bytes --]

_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-30 15:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-24  9:29 [uml-devel] fix SEGV in handle_page_fault() when current->mm is NULL Nicolas S. Dade
2007-05-26 11:02 ` Blaisorblade
2007-05-30 15:30 ` Jeff Dike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.