diff options
-rw-r--r-- | virt/kvm/kvm_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 22cdb960660a..383f492a6603 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -651,7 +651,9 @@ int __kvm_set_memory_region(struct kvm *kvm, | |||
651 | /* We can read the guest memory with __xxx_user() later on. */ | 651 | /* We can read the guest memory with __xxx_user() later on. */ |
652 | if (user_alloc && | 652 | if (user_alloc && |
653 | ((mem->userspace_addr & (PAGE_SIZE - 1)) || | 653 | ((mem->userspace_addr & (PAGE_SIZE - 1)) || |
654 | !access_ok(VERIFY_WRITE, mem->userspace_addr, mem->memory_size))) | 654 | !access_ok(VERIFY_WRITE, |
655 | (void __user *)(unsigned long)mem->userspace_addr, | ||
656 | mem->memory_size))) | ||
655 | goto out; | 657 | goto out; |
656 | if (mem->slot >= KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) | 658 | if (mem->slot >= KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) |
657 | goto out; | 659 | goto out; |