From: Mikhail Ilin <m.ilin@samsung.com>
To: qemu-devel@nongnu.org, 'Yury Gribov' <y.gribov@samsung.com>,
Slava Garbuzov <v.garbuzov@samsung.com>
Subject: [Qemu-devel] [PATCH for-2.1] linux-user: hide reserved mmap in /proc/self/mmap
Date: Fri, 18 Jul 2014 11:42:31 +0400 [thread overview]
Message-ID: <53C8CFE7.5080406@samsung.com> (raw)
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 <m.ilin@samsung.com>
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 <m.ilin@samsung.com>
---
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,
--
1.9.1
next reply other threads:[~2014-07-18 7:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 7:42 Mikhail Ilin [this message]
2014-07-23 5:24 ` [Qemu-devel] [PATCH for-2.1] linux-user: hide reserved mmap in /proc/self/mmap Mikhail Ilin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53C8CFE7.5080406@samsung.com \
--to=m.ilin@samsung.com \
--cc=qemu-devel@nongnu.org \
--cc=v.garbuzov@samsung.com \
--cc=y.gribov@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.