From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NqFU2-0003lW-D1 for qemu-devel@nongnu.org; Fri, 12 Mar 2010 19:45:38 -0500 Received: from [199.232.76.173] (port=52187 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NqFU0-0003lO-TL for qemu-devel@nongnu.org; Fri, 12 Mar 2010 19:45:36 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NqFU0-00041Q-9b for qemu-devel@nongnu.org; Fri, 12 Mar 2010 19:45:36 -0500 Received: from mx20.gnu.org ([199.232.41.8]:59711) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NqFU0-00041M-2I for qemu-devel@nongnu.org; Fri, 12 Mar 2010 19:45:36 -0500 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NqFTz-0002FZ-1v for qemu-devel@nongnu.org; Fri, 12 Mar 2010 19:45:35 -0500 From: Paul Brook Date: Sat, 13 Mar 2010 00:45:22 +0000 References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003130045.22664.paul@codesourcery.com> Subject: [Qemu-devel] Re: linux-user issues List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org, Aurelien Jarno > a) elfload.c:859 > > #define TARGET_ELF_PAGESTART(_v) ((_v) & ~(unsigned > long)(TARGET_ELF_EXEC_PAGESIZE-1)) > > This means that for 64bit guest on a 32bit host the _v's value is > silently reduced to 32bit, the cast should be abi_ulong. > > b) mmap.c:428 > > real_start = start & qemu_host_page_mask; > > Same thing basically qemu_host_page_mask is unsigned long and so > the upper bits are sliently cleared. Again qemu_host_page_mask > should probably be abi_ulong. > > The above two make elf binary with one of the segments above 4G load > and run on 32bit guest only to fail well into execution and without > any indication that it shouldn't have been allowed to run in the first > place. I'd be amazed if these are the only two issues, and expect 64-bit guests on 32-bit hosts to be generally unsafe. Paul