From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60381 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhTqo-0006e9-M9 for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:21:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhTqm-0001Jb-J8 for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:21:25 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:39357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhTqm-0001JT-El for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:21:24 -0500 Received: by iye19 with SMTP id 19so4588136iye.4 for ; Mon, 24 Jan 2011 13:21:23 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4D3DE7F8.6080807@gmail.com> References: <4D3D63B3.1030402@gmail.com> <4D3DC1F6.9030800@gmail.com> <4D3DE7F8.6080807@gmail.com> From: Mike Frysinger Date: Mon, 24 Jan 2011 16:21:03 -0500 Message-ID: Subject: Re: [Qemu-devel] qemu-user: relocating target code weakness Content-Type: text/plain; charset=UTF-8 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Bonifazi Cc: Mulyadi Santosa , QEMU Developers On Mon, Jan 24, 2011 at 15:58, Stefano Bonifazi wrote: >> review the mmap() man page ... MAP_FIXED is always a *suggestion* and >> never a requirement. the app must check the return value to see what >> the kernel actually gave it. > > Sorry, wrong! > > MAP_FIXED > Don't interpret addr as a hint: place the mapping at exactly > that > address. [] If the specified address cannot be used, mmap() > will fail.[] err, yes. i was thinking the specified address when MAP_FIXED isnt used. since qemu itself has its own mappings, there is a slightly greater possibility of the simulated program making a MAP_FIXED request that clashes with qemu itself, or with addresses that are free in the simulated arch's ABI but reserved in the host processor's ABI. but that can happen with the app running natively too, so any app not handling MAP_FIXED failures is buggy and not qemu's problem. -mike