From: Avi Kivity Subject: [PATCH] KVM: Zero guest memory before use Date: Thu, 30 Nov 2006 12:35:00 -0000 Message-ID: <20061130123500.9440E25017B@cleopatra.q> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: akpm-3NddpPZAyC0@public.gmane.org, mingo-X9Un+BFzKDI@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Return-path: To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This prevents an information leak from the host to the vmm and the guest. Signed-off-by: Avi Kivity diff -X /home/avi/kvm/linux-2.6/Documentation/dontdiff --exclude=Makefile -ru /home/avi/kvm/linux-2.6/drivers/kvm/kvm_main.c /home/avi/kvm-release/kernel/kvm_main.c --- linux-2.6/drivers/kvm/kvm_main.c 2006-11-30 10:59:57.000000000 +0200 +++ linux-2.6/drivers/kvm/kvm_main.c 2006-11-30 14:26:29.000000000 +0200 @@ -620,7 +620,8 @@ memset(new.phys_mem, 0, npages * sizeof(struct page *)); for (i = 0; i < npages; ++i) { - new.phys_mem[i] = alloc_page(GFP_HIGHUSER); + new.phys_mem[i] = alloc_page(GFP_HIGHUSER + | __GFP_ZERO); if (!new.phys_mem[i]) goto out_free; } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV