public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: WANG Cong <xiyou.wangcong@gmail.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
	virtualization <virtualization@lists.linux-foundation.org>
Subject: Re: [RELEASE] Lguest for 2.6.21
Date: Thu, 3 May 2007 03:33:03 +0800	[thread overview]
Message-ID: <20070502193303.GA1502@localhost.localdomain> (raw)
In-Reply-To: <1178117028.19815.14.camel@localhost.localdomain>

Hi Rusty!

I found you forgot to check the return value of copy_from_user, and here is the fix for drivers/lguest/interrupts_and_traps.c.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

--- linux-2.6.21-rc7-mm2/drivers/lguest/interrupts_and_traps.c.orig	2007-05-03 03:10:44.000000000 +0800
+++ linux-2.6.21-rc7-mm2/drivers/lguest/interrupts_and_traps.c	2007-05-03 03:11:42.000000000 +0800
@@ -75,7 +75,8 @@ void maybe_do_interrupt(struct lguest *l
 		set_bit(0, lg->irqs_pending);
 
 	/* Mask out any interrupts they have blocked. */
-	copy_from_user(&blk, lg->lguest_data->blocked_interrupts, sizeof(blk));
+	if (copy_from_user(&blk, lg->lguest_data->blocked_interrupts, sizeof(blk)))
+		return;
 	bitmap_andnot(blk, lg->irqs_pending, blk, LGUEST_IRQS);
 
 	irq = find_first_bit(blk, LGUEST_IRQS);

  reply	other threads:[~2007-05-02 19:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-02 14:43 [RELEASE] Lguest for 2.6.21 Rusty Russell
2007-05-02 19:33 ` WANG Cong [this message]
2007-05-02 19:59   ` WANG Cong
2007-05-02 23:00   ` Rusty Russell
2007-05-03  3:57     ` WANG Cong
2007-05-03  4:20       ` Rusty Russell
2007-05-03  5:43         ` WANG Cong
2007-05-03 16:02 ` Matt Mackall
2007-05-04  0:13   ` Rusty Russell
2007-05-04  0:43     ` Rusty Russell
2007-05-04  3:20       ` Matt Mackall
2007-05-04  3:39         ` 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=20070502193303.GA1502@localhost.localdomain \
    --to=xiyou.wangcong@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --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