|
From: | Stefano Bonifazi |
Subject: | Re: [Qemu-devel] qemu-user: relocating target code weakness |
Date: | Mon, 24 Jan 2011 21:58:32 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 |
Hi! Thank you for your answer! Uhmm that makes sense and explains many things like why they can simply consider always possible that the target is allocated at elf_ppnt->p_vaddr, without risking it to clash with qemu-user code..he is telling you what ELF_START_MMAP is all about. it is the base address that the linux kernel for that architecture will start giving out addresses. so when running Linux on an x86 system, the first mmap() a process does will start at 0x80000000 and move up. although looking at the elfload code quickly, it doesnt seem that this is really used anymore. so it probably can be ignored. Sorry, wrong!Inside load_elf_binary the call to mmap has elf_ppnt->p_vaddr as required starting address (plus alignment) and MAP_FIXED flag.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. 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.[]http://www.kernel.org/doc/man-pages/online/pages/man2/mmap.2.html Thank you! Best regards! Stefano B. |
[Prev in Thread] | Current Thread | [Next in Thread] |