Patchwork [2/3] KVM: PPC: Initialize linears with zeros

login
register
mail settings
Submitter Alexander Graf
Date Jan. 18, 2012, 11:17 p.m.
Message ID <1326928658-10791-3-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/136724/
State New
Headers show

Comments

Alexander Graf - Jan. 18, 2012, 11:17 p.m.
RMAs and HPT preallocated spaces should be zeroed, so we don't accidently
leak information from previous VM executions.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/book3s_hv_builtin.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Paul Mackerras - Jan. 19, 2012, 9:30 a.m.
On Thu, Jan 19, 2012 at 12:17:37AM +0100, Alexander Graf wrote:
> RMAs and HPT preallocated spaces should be zeroed, so we don't accidently
> leak information from previous VM executions.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>

Acked-by: Paul Mackerras <paulus@samba.org>
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c
index 1c7e6ab..7caed1d 100644
--- a/arch/powerpc/kvm/book3s_hv_builtin.c
+++ b/arch/powerpc/kvm/book3s_hv_builtin.c
@@ -152,6 +152,7 @@  static struct kvmppc_linear_info *kvm_alloc_linear(int type)
 		break;
 	}
 	spin_unlock(&linear_lock);
+	memset(ri->base_virt, 0, ri->npages << PAGE_SHIFT);
 	return ri;
 }