diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-04-17 19:21:06 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-04-21 16:13:13 +0300 |
commit | e72436bc3a5206f95bb384e741154166ddb3202e (patch) | |
tree | 3bbd58436dcb3900f1f0c276e497b8381d0b169b /fs | |
parent | 997b7e98990cd44243651827e4efa366d9885907 (diff) | |
download | linux-e72436bc3a5206f95bb384e741154166ddb3202e.tar.xz |
KVM: SVM: avoid infinite loop on NPF from bad address
When a nested page fault is taken from an address that does not have
a memslot associated to it, kvm_mmu_do_page_fault returns RET_PF_EMULATE
(via mmu_set_spte) and kvm_mmu_page_fault then invokes svm_need_emulation_on_page_fault.
The default answer there is to return false, but in this case this just
causes the page fault to be retried ad libitum. Since this is not a
fast path, and the only other case where it is taken is an erratum,
just stick a kvm_vcpu_gfn_to_memslot check in there to detect the
common case where the erratum is not happening.
This fixes an infinite loop in the new set_memory_region_test.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions