Re: [PATCH 3/4] KVM: x86/mmu: Fix RCU usage when atomically zapping SPTEs

2021-03-12 Thread Sean Christopherson
On Thu, Mar 11, 2021, Ben Gardon wrote:
> Fix a missing rcu_dereference in tdp_mmu_zap_spte_atomic.
> 
> Reported-by: kernel test robot 

s/x/intel.com

Reviewed-by: Sean Christopherson 

> Signed-off-by: Ben Gardon 


[PATCH 3/4] KVM: x86/mmu: Fix RCU usage when atomically zapping SPTEs

2021-03-11 Thread Ben Gardon
Fix a missing rcu_dereference in tdp_mmu_zap_spte_atomic.

Reported-by: kernel test robot 
Signed-off-by: Ben Gardon 
---
 arch/x86/kvm/mmu/tdp_mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
index 6c8824bcc2f2..a8fdccf4fd06 100644
--- a/arch/x86/kvm/mmu/tdp_mmu.c
+++ b/arch/x86/kvm/mmu/tdp_mmu.c
@@ -532,7 +532,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;
 }
-- 
2.31.0.rc2.261.g7f71774620-goog