Commit a6085fba authored by Marcelo Tosatti's avatar Marcelo Tosatti

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: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent d72118ce
......@@ -150,7 +150,9 @@ static int FNAME(walk_addr)(struct guest_walker *walker,
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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment