linux-um archives
 help / color / mirror / Atom feed
From: "Nicolas S. Dade" <n-dade@nsd.dyndns.org>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] fix SEGV in handle_page_fault() when current->mm is NULL
Date: Thu, 24 May 2007 02:29:04 -0700	[thread overview]
Message-ID: <20070524092904.GB3768@sparc20.esperanza> (raw)

[-- 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

             reply	other threads:[~2007-05-24  9:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-24  9:29 Nicolas S. Dade [this message]
2007-05-26 11:02 ` [uml-devel] fix SEGV in handle_page_fault() when current->mm is NULL Blaisorblade
2007-05-30 15:30 ` Jeff Dike

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070524092904.GB3768@sparc20.esperanza \
    --to=n-dade@nsd.dyndns.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox