]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: X86: Sanity check on gfn before removal
authorPeter Xu <peterx@redhat.com>
Thu, 16 Apr 2020 15:59:10 +0000 (11:59 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 15 May 2020 16:26:15 +0000 (12:26 -0400)
commitc07c4fc7c5a2becf8a9912c207207c5f3860bbf3
treee8e654b6096da7f83ef30b9f924ebe25cd57b67b
parent8235fa7fe280c340821658b7dc1ef74e7b9ed0bc
KVM: X86: Sanity check on gfn before removal

The index returned by kvm_async_pf_gfn_slot() will be removed when an
async pf gfn is going to be removed.  However kvm_async_pf_gfn_slot()
is not reliable in that it can return the last key it loops over even
if the gfn is not found in the async gfn array.  It should never
happen, but it's still better to sanity check against that to make
sure no unexpected gfn will be removed.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20200416155910.267514-1-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c