From: Rusty Russell <rusty@rustcorp.com.au>
To: virtualization@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org, Jeremy Katz <katzj@redhat.com>
Subject: [PATCH 3/4] virtio: handle > 2 billion page balloon targets
Date: Tue, 11 Mar 2008 23:05:23 +1100 [thread overview]
Message-ID: <200803112305.23648.rusty@rustcorp.com.au> (raw)
In-Reply-To: <200803112304.21680.rusty@rustcorp.com.au>
If the host asks for a huge target towards_target() can overflow, and
we up oops as we try to release more pages than we have. The simple
fix is to use a 64-bit value.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
drivers/virtio/virtio_balloon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -r fd0c80dbbd95 drivers/virtio/virtio_balloon.c
--- a/drivers/virtio/virtio_balloon.c Tue Mar 11 09:21:00 2008 +1100
+++ b/drivers/virtio/virtio_balloon.c Tue Mar 11 11:25:52 2008 +1100
@@ -152,7 +152,7 @@ static void virtballoon_changed(struct v
wake_up(&vb->config_change);
}
-static inline int towards_target(struct virtio_balloon *vb)
+static inline s64 towards_target(struct virtio_balloon *vb)
{
u32 v;
__virtio_config_val(vb->vdev,
@@ -176,7 +183,7 @@ static int balloon(void *_vballoon)
set_freezable();
while (!kthread_should_stop()) {
- int diff;
+ s64 diff;
try_to_freeze();
wait_event_interruptible(vb->config_change,
next prev parent reply other threads:[~2008-03-11 12:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-11 12:03 [PATCH 1/4] virtio: Use spin_lock_irqsave/restore for virtio-pci Rusty Russell
2008-03-11 12:04 ` [PATCH 2/4] virtio: Fix sysfs bits to have proper block symlink Rusty Russell
2008-03-11 12:04 ` Rusty Russell
2008-03-11 12:05 ` [PATCH 3/4] virtio: handle > 2 billion page balloon targets Rusty Russell
2008-03-11 12:05 ` Rusty Russell [this message]
2008-03-11 12:06 ` [PATCH 4/4] virtio: Enable netpoll interface for netconsole logging Rusty Russell
2008-03-11 12:06 ` 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=200803112305.23648.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=katzj@redhat.com \
--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 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.