From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
virtualization <virtualization@lists.linux-foundation.org>
Subject: [PATCH] Fix lguest oops when guest dies while receiving I/O
Date: Thu, 26 Apr 2007 20:45:10 +1000 [thread overview]
Message-ID: <1177584310.30071.60.camel@localhost.localdomain> (raw)
lguest needs to hold a reference to its task in case it exits while
another Guest is sending it I/O. Otherwise we can oops in
access_process_vm->get_task_mm->task_lock().
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
drivers/lguest/lguest_user.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
===================================================================
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -107,7 +107,8 @@ static int initialize(struct file *file,
setup_regs(lg->regs, args[2]);
setup_guest_gdt(lg);
lg->tsk = current;
- lg->mm = get_task_mm(current);
+ get_task_struct(lg->tsk);
+ lg->mm = get_task_mm(lg->tsk);
lg->last_pages = NULL;
mutex_unlock(&lguest_lock);
@@ -160,6 +161,7 @@ static int close(struct inode *inode, st
mutex_lock(&lguest_lock);
release_all_dma(lg);
free_guest_pagetable(lg);
+ put_task_struct(lg->tsk);
mmput(lg->mm);
if (!IS_ERR(lg->dead))
kfree(lg->dead);
next reply other threads:[~2007-04-26 10:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-26 10:45 Rusty Russell [this message]
2007-04-26 10:46 ` [PATCH] Fix lguest documentation error Rusty Russell
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=1177584310.30071.60.camel@localhost.localdomain \
--to=rusty@rustcorp.com.au \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/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
all inboxes | Powered by JetHome®