summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorBen Gardon <bgardon@google.com>2021-03-16 02:38:01 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2021-03-16 21:15:24 +0300
commit14f6fec2e8e04b83c87c339b8d8ff4cc62b23d35 (patch)
tree1694fa85ad6c054e6197ed3eadeb285ab01b34ce /arch
parent70fb3e41a97a5fecc0aedc9a429479d702c3ab66 (diff)
downloadlinux-14f6fec2e8e04b83c87c339b8d8ff4cc62b23d35.tar.xz
KVM: x86/mmu: Fix RCU usage when atomically zapping SPTEs
Fix a missing rcu_dereference in tdp_mmu_zap_spte_atomic. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Ben Gardon <bgardon@google.com> Message-Id: <20210315233803.2706477-3-bgardon@google.com> Reviewed-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/mmu/tdp_mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
index db2936cca4bf..946da74e069c 100644
--- a/arch/x86/kvm/mmu/tdp_mmu.c
+++ b/arch/x86/kvm/mmu/tdp_mmu.c
@@ -543,7 +543,7 @@ static inline bool tdp_mmu_zap_spte_atomic(struct kvm *kvm,
* here since the SPTE is going from non-present
* to non-present.
*/
- WRITE_ONCE(*iter->sptep, 0);
+ WRITE_ONCE(*rcu_dereference(iter->sptep), 0);
return true;
}