diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2020-09-23 11:37:28 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-29 09:05:32 +0100 |
commit | 6049f7d96af57b5342ac0966feb2846877fe62c5 (patch) | |
tree | cab9f59c3093217cee94f1dcd4a2ea2ddc837dbf /security | |
parent | f37902608d4652d564334f8ca0e7a7f1d32c9142 (diff) | |
download | linux-stable-6049f7d96af57b5342ac0966feb2846877fe62c5.tar.gz linux-stable-6049f7d96af57b5342ac0966feb2846877fe62c5.tar.bz2 linux-stable-6049f7d96af57b5342ac0966feb2846877fe62c5.zip |
KVM: x86/mmu: Commit zap of remaining invalid pages when recovering lpages
commit e89505698c9f70125651060547da4ff5046124fc upstream.
Call kvm_mmu_commit_zap_page() after exiting the "prepare zap" loop in
kvm_recover_nx_lpages() to finish zapping pages in the unlikely event
that the loop exited due to lpage_disallowed_mmu_pages being empty.
Because the recovery thread drops mmu_lock() when rescheduling, it's
possible that lpage_disallowed_mmu_pages could be emptied by a different
thread without to_zap reaching zero despite to_zap being derived from
the number of disallowed lpages.
Fixes: 1aa9b9572b105 ("kvm: x86: mmu: Recovery of shattered NX large pages")
Cc: Junaid Shahid <junaids@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200923183735.584-2-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions