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 <yjwei@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
8ec4722dd2
commit
646bab55a2
|
@ -455,8 +455,10 @@ static void kvmppc_patch_dcbz(struct kvm_vcpu *vcpu, struct kvmppc_pte *pte)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
hpage = gfn_to_page(vcpu->kvm, pte->raddr >> PAGE_SHIFT);
|
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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
hpage_offset = pte->raddr & ~PAGE_MASK;
|
hpage_offset = pte->raddr & ~PAGE_MASK;
|
||||||
hpage_offset &= ~0xFFFULL;
|
hpage_offset &= ~0xFFFULL;
|
||||||
|
|
Loading…
Reference in New Issue