summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2010-01-14 17:41:27 -0200
committerMarcelo Tosatti <mtosatti@redhat.com>2010-01-25 12:26:38 -0200
commita6085fbaf65ab09bfb5ec8d902d6d21680fe1895 (patch)
tree78e2ca9d3bc6d2ea81bb01952ef22cc9c17a7c9f /arch/x86
parentd72118cecabbb76b96b77107a50c74d1bb36c0c1 (diff)
downloadlinux-a6085fbaf65ab09bfb5ec8d902d6d21680fe1895.tar.gz
linux-a6085fbaf65ab09bfb5ec8d902d6d21680fe1895.tar.bz2
linux-a6085fbaf65ab09bfb5ec8d902d6d21680fe1895.zip
KVM: MMU: bail out pagewalk on kvm_read_guest error
Exit the guest pagetable walk loop if reading gpte failed. Otherwise its possible to enter an endless loop processing the previous present pte. Cc: stable@kernel.org Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/paging_tmpl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 58a0f1e88596..ede2131a9225 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -150,7 +150,9 @@ walk:
walker->table_gfn[walker->level - 1] = table_gfn;
walker->pte_gpa[walker->level - 1] = pte_gpa;
- kvm_read_guest(vcpu->kvm, pte_gpa, &pte, sizeof(pte));
+ if (kvm_read_guest(vcpu->kvm, pte_gpa, &pte, sizeof(pte)))
+ goto not_present;
+
trace_kvm_mmu_paging_element(pte, walker->level);
if (!is_present_gpte(pte))