From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMwOT-0004Uk-Fd for qemu-devel@nongnu.org; Tue, 12 Jul 2016 08:02:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMwOO-0003QP-2R for qemu-devel@nongnu.org; Tue, 12 Jul 2016 08:02:28 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:58239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMwON-0003Q5-Qw for qemu-devel@nongnu.org; Tue, 12 Jul 2016 08:02:23 -0400 From: Peter Maydell Date: Tue, 12 Jul 2016 13:02:12 +0100 Message-Id: <1468324939-12221-2-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1468324939-12221-1-git-send-email-peter.maydell@linaro.org> References: <1468324939-12221-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 1/8] linux-user: Pass missing MAP_ANONYMOUS to target_mmap() call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: patches@linaro.org, Riku Voipio , Paolo Bonzini 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 --- 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 f807baf..38e210e 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); } } -- 1.9.1