[patch 008/108] KVM: Prevent overflow in largepages calculation
From: Greg KH
Date: Tue Jun 30 2009 - 20:49:06 EST
2.6.30-stable review patch. If anyone has any objections, please let us know.
------------------
From: Avi Kivity <avi@xxxxxxxxxx>
commit 09f8ca74ae6c2d78b2c7f6c0751ed0cbe815a3d9 upstream.
If userspace specifies a memory slot that is larger than 8 petabytes, it
could overflow the largepages variable.
Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
virt/kvm/kvm_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -920,8 +920,7 @@ int __kvm_set_memory_region(struct kvm *
int r;
gfn_t base_gfn;
unsigned long npages, ugfn;
- int largepages;
- unsigned long i;
+ unsigned long largepages, i;
struct kvm_memory_slot *memslot;
struct kvm_memory_slot old, new;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/