Skip to contentSkip to conversation

KVM: PPC: fix leakage of page release in kvmppc_patch_dcbz()

PATCH Superseded Wei Yongjun 1 participant 1 message Jul 15, 2010

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

PATCH 1/1 KVM: PPC: fix leakage of page release in kvmppc_patch_dcbz()

Add kvm_release_page_clean() after is_error_page() to avoid leakage of error page. No test.

---
 arch/powerpc/kvm/book3s.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/powerpc/kvm/book3s.c +3 -1
index a3cef30..5baa3ab 100644
@@ -415,8 +415,10 @@ static void kvmppc_patch_dcbz(struct kvm_vcpu *vcpu, struct kvmppc_pte *pte)
 	int i;
 
 	hpage = gfn_to_page(vcpu->kvm, pte->raddr >> PAGE_SHIFT);
-	if (is_error_page(hpage))
+	if (is_error_page(hpage)) {
+		kvm_release_page_clean(hpage);
 		return;
+	}
 
 	hpage_offset = pte->raddr & ~PAGE_MASK;
 	hpage_offset &= ~0xFFFULL;
Signature · 1 line
1.7.0.4