From: Wei Yongjun Date: Tue, 17 Aug 2010 02:08:52 +0000 (+0800) Subject: KVM: PPC: fix leakage of error page in kvmppc_patch_dcbz() X-Git-Tag: firefly_0821_release~7613^2~3665^2~207 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=646bab55a278ceb1cf43b1f80d3dd468be62a421;p=firefly-linux-kernel-4.4.55.git KVM: PPC: fix leakage of error page in kvmppc_patch_dcbz() Add kvm_release_page_clean() after is_error_page() to avoid leakage of error page. Signed-off-by: Wei Yongjun Signed-off-by: Avi Kivity --- diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index eee97b5a7400..7656b6df0d8b 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c @@ -455,8 +455,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;