KVM: Fix a race condition for usage of is_hwpoison_address()
authorHuang Ying <ying.huang@intel.com>
Tue, 22 Jun 2010 06:23:11 +0000 (14:23 +0800)
committerAvi Kivity <avi@redhat.com>
Sun, 1 Aug 2010 07:47:11 +0000 (10:47 +0300)
commitbbeb34062fbad287c949a945a516a0c15b179993
treecf29b50e076ba1ddc07d5b1292f243653a2f67a9
parent6c3f6041172b78d5532c6bf3680d304e92ec2e66
KVM: Fix a race condition for usage of is_hwpoison_address()

is_hwpoison_address accesses the page table, so the caller must hold
current->mm->mmap_sem in read mode. So fix its usage in hva_to_pfn of
kvm accordingly.

Comment is_hwpoison_address to remind other users.

Reported-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
mm/memory-failure.c
virt/kvm/kvm_main.c