Skip to contentSkip to conversation

KVM: MMU: fix sync of ptes addressed at owner pagetable

PATCH Applied Marcelo Tosatti 2 participants 2 messages Nov 21, 2008 – Nov 23, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

During page sync, if a pagetable contains a self referencing pte (that points to the pagetable), the corresponding spte may be marked as writable even though all mappings are supposed to be write protected.

Fix by clearing page unsync before syncing individual sptes.

arch/x86/kvm/mmu.c +1 -1
index 0813a08..8904e8a 100644
@@ -1046,13 +1046,13 @@ static int kvm_sync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
 	}
 
 	rmap_write_protect(vcpu->kvm, sp->gfn);
+	kvm_unlink_unsync_page(vcpu->kvm, sp);
 	if (vcpu->arch.mmu.sync_page(vcpu, sp)) {
 		kvm_mmu_zap_page(vcpu->kvm, sp);
 		return 1;
 	}
 
 	kvm_mmu_flush_tlb(vcpu);
-	kvm_unlink_unsync_page(vcpu->kvm, sp);
 	return 0;
 }
 
Applied
#1 lore raw
Quoted 7 lines · Marcelo Tosatti

During page sync, if a pagetable contains a self referencing pte (that points to the pagetable), the corresponding spte may be marked as writable even though all mappings are supposed to be write protected.

Fix by clearing page unsync before syncing individual sptes.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function