mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-26 02:25:00 -05:00
KVM: Prevent overflow in largepages calculation
If userspace specifies a memory slot that is larger than 8 petabytes, it could overflow the largepages variable. Cc: stable@kernel.org Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
ac04527f79
commit
09f8ca74ae
1 changed files with 1 additions and 2 deletions
|
@ -1087,8 +1087,7 @@ int __kvm_set_memory_region(struct kvm *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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue