From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9p2c-0003G1-Tm for qemu-devel@nongnu.org; Wed, 23 Jul 2014 01:24:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X9p2V-0007Rv-MQ for qemu-devel@nongnu.org; Wed, 23 Jul 2014 01:24:38 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:53441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9p2V-0007Rn-Gp for qemu-devel@nongnu.org; Wed, 23 Jul 2014 01:24:31 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N95008X1GCBFC70@mailout2.w1.samsung.com> for qemu-devel@nongnu.org; Wed, 23 Jul 2014 06:24:11 +0100 (BST) Message-id: <53CF4709.2070902@samsung.com> Date: Wed, 23 Jul 2014 09:24:25 +0400 From: Mikhail Ilin MIME-version: 1.0 References: <53C8CFE7.5080406@samsung.com> In-reply-to: <53C8CFE7.5080406@samsung.com> Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.1] linux-user: hide reserved mmap in /proc/self/mmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, 'Yury Gribov' , Slava Garbuzov Cc: riku.voipio@iki.fi Adding Riku Voipio On 18.07.2014 11:42, Mikhail Ilin wrote: > Hi, > > Running 32-bits binaries with address sanitizer (ASAN) instrumentations > fails under 64-bits qemu. During initialization ASAN relies on the output > from /proc/self/mmap then tries to find a big chunk for shadow memory but > it is not happened. > > Reserved memory for guest address space is used privately by qemu to > satisfy user anonymous mmap calls but in the same time it is not hidden > from an application and is reported when a user reads /proc/self/mmap. > Qemu is not fully transparent for a guest. > > The patch covers the case and cleans up the reserved memory map from > the output. > > > From 167c42e6a9521c05ddd7c6dfbb108d2ae65de098 Mon Sep 17 00:00:00 2001 > From: Mikhail Ilyin > Date: Fri, 18 Jul 2014 10:14:06 +0400 > Subject: [PATCH] Clean up the reserved memory map from /proc/self/mmap > output > which doesn't belong to an emulated process. > > Signed-off-by: Mikhail Ilyin > --- > linux-user/syscall.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index a50229d..8f406e4 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -5122,6 +5122,13 @@ static int open_self_maps(void *cpu_env, int fd) > continue; > } > if (h2g_valid(min) && h2g_valid(max)) { > +#ifdef CONFIG_USE_GUEST_BASE > + if (RESERVED_VA) { > + if (mmap_next_start == h2g(max)) { > + continue; > + } > + } > +#endif > dprintf(fd, TARGET_ABI_FMT_lx "-" TARGET_ABI_FMT_lx > " %c%c%c%c %08" PRIx64 " %02x:%02x %d %s%s\n", > h2g(min), h2g(max), flag_r, flag_w,