aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-07-12 13:02:12 +0100
committerRiku Voipio <riku.voipio@linaro.org>2016-09-21 14:26:23 +0300
commit68754b442b756e8cb5f143b00937fb7330a51a81 (patch)
treeb654f601e7e8b80e17bd49181a8c236a709f25a3 /linux-user
parent0cb581d6bdc5aa808ae1a9789d02657fe531cb39 (diff)
downloadqemu-68754b442b756e8cb5f143b00937fb7330a51a81.zip
qemu-68754b442b756e8cb5f143b00937fb7330a51a81.tar.gz
qemu-68754b442b756e8cb5f143b00937fb7330a51a81.tar.bz2
linux-user: Pass missing MAP_ANONYMOUS to target_mmap() call
A target_mmap() call in load_elf_binary() was missing the MAP_ANONYMOUS flag. (Spotted by Coverity, because target_mmap() will try to use -1 as the filedescriptor in this case.) This has never been noticed because the code in question is for handling ancient SVr4 iBCS2 binaries. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/elfload.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 29455e4..e9a3882 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2233,7 +2233,7 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info)
we do not have the power to recompile these, we emulate
the SVr4 behavior. Sigh. */
target_mmap(0, qemu_host_page_size, PROT_READ | PROT_EXEC,
- MAP_FIXED | MAP_PRIVATE, -1, 0);
+ MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
}
}