]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Validate userspace_addr of memslot when registered
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Sat, 7 May 2011 07:35:38 +0000 (16:35 +0900)
committerAvi Kivity <avi@redhat.com>
Sun, 22 May 2011 12:47:56 +0000 (08:47 -0400)
commit4b7df28d24ad0e4d233555fc85f7438f47613d9b
tree79205998f6734b51628f92641124dbe4aaa9882f
parentdc03d814e0cc0eb8234952a2a93f398f9622ba67
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>
arch/x86/kvm/paging_tmpl.h
virt/kvm/kvm_main.c