summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/paging_tmpl.h
diff options
context:
space:
mode:
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>2011-05-07 07:35:38 (GMT)
committerAvi Kivity <avi@redhat.com>2011-05-22 12:47:56 (GMT)
commitfa3d315a4ce2c0891cdde262562e710d95fba19e (patch)
tree79205998f6734b51628f92641124dbe4aaa9882f /arch/x86/kvm/paging_tmpl.h
parent12cb814f3bb35736420cc6bfc9fed7b6a9d3a828 (diff)
downloadlinux-fsl-qoriq-fa3d315a4ce2c0891cdde262562e710d95fba19e.tar.xz
KVM: Validate userspace_addr of memslot when registered
This way, we can avoid checking the user space address many times when we read the guest memory. Although we can do the same for write if we check which slots are writable, we do not care write now: reading the guest memory happens more often than writing. [avi: change VERIFY_READ to VERIFY_WRITE] Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/paging_tmpl.h')
-rw-r--r--arch/x86/kvm/paging_tmpl.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 88ca456..e3f8141 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -185,7 +185,7 @@ walk:
}
ptep_user = (pt_element_t __user *)((void *)host_addr + offset);
- if (unlikely(copy_from_user(&pte, ptep_user, sizeof(pte)))) {
+ if (unlikely(__copy_from_user(&pte, ptep_user, sizeof(pte)))) {
present = false;
break;
}