* [PATCH] kvm tools: balloon: fix overflow in PFN to address conversion
@ 2014-08-20 14:37 Konstantin Khlebnikov
0 siblings, 0 replies; only message in thread
From: Konstantin Khlebnikov @ 2014-08-20 14:37 UTC (permalink / raw)
To: Pekka Enberg, Sasha Levin; +Cc: kvm
Fix trivial overflow of u32 value
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
---
tools/kvm/virtio/balloon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/kvm/virtio/balloon.c b/tools/kvm/virtio/balloon.c
index f7dfb0b..84c4bb0 100644
--- a/tools/kvm/virtio/balloon.c
+++ b/tools/kvm/virtio/balloon.c
@@ -64,7 +64,7 @@ static bool virtio_bln_do_io_request(struct kvm *kvm, struct bln_dev *bdev, stru
for (i = 0 ; i < len ; i++) {
void *guest_ptr;
- guest_ptr = guest_flat_to_host(kvm, ptrs[i] << VIRTIO_BALLOON_PFN_SHIFT);
+ guest_ptr = guest_flat_to_host(kvm, (u64)ptrs[i] << VIRTIO_BALLOON_PFN_SHIFT);
if (queue == &bdev->vqs[VIRTIO_BLN_INFLATE]) {
madvise(guest_ptr, 1 << VIRTIO_BALLOON_PFN_SHIFT, MADV_DONTNEED);
bdev->config.actual++;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-08-20 14:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-20 14:37 [PATCH] kvm tools: balloon: fix overflow in PFN to address conversion Konstantin Khlebnikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox