From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoDe3-00047C-W8 for qemu-devel@nongnu.org; Mon, 09 Jul 2012 09:04:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoDdx-0002xK-Rl for qemu-devel@nongnu.org; Mon, 09 Jul 2012 09:04:55 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:43575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoDdx-0002wH-MK for qemu-devel@nongnu.org; Mon, 09 Jul 2012 09:04:49 -0400 From: Mike Frysinger Date: Mon, 9 Jul 2012 09:04:57 -0400 Message-Id: <1341839097-4074-1-git-send-email-vapier@gentoo.org> Subject: [Qemu-devel] [PATCH] flatload: fix bss clearing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Riku Voipio The current bss clear logic assumes the target mmap address and host address are the same. Use g2h to translate from the target address space to the host so we can call memset on it. Signed-off-by: Mike Frysinger --- linux-user/flatload.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/linux-user/flatload.c b/linux-user/flatload.c index be79496..58f679e 100644 --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -660,7 +660,7 @@ static int load_flat_file(struct linux_binprm * bprm, } /* zero the BSS. */ - memset((void *)((unsigned long)datapos + data_len), 0, bss_len); + memset(g2h(datapos + data_len), 0, bss_len); return 0; } -- 1.7.7.3