|
@@ -651,7 +651,9 @@ int __kvm_set_memory_region(struct kvm *kvm,
|
|
|
/* We can read the guest memory with __xxx_user() later on. */
|
|
|
if (user_alloc &&
|
|
|
((mem->userspace_addr & (PAGE_SIZE - 1)) ||
|
|
|
- !access_ok(VERIFY_WRITE, mem->userspace_addr, mem->memory_size)))
|
|
|
+ !access_ok(VERIFY_WRITE,
|
|
|
+ (void __user *)(unsigned long)mem->userspace_addr,
|
|
|
+ mem->memory_size)))
|
|
|
goto out;
|
|
|
if (mem->slot >= KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS)
|
|
|
goto out;
|