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
--- 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);
-------------------------------------------------------------------------
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/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to