qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 09/26] linux-user: Pass missing MAP_ANONYMOUS to targ


From: riku . voipio
Subject: [Qemu-devel] [PULL 09/26] linux-user: Pass missing MAP_ANONYMOUS to target_mmap() call
Date: Thu, 22 Sep 2016 15:13:29 +0300

From: Peter Maydell <address@hidden>

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 <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
 linux-user/elfload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
         }
     }
 
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]