This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/11754] RFE: dlopen of ET_EXEC file
- From: "jreiser at BitWagon dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 25 Jun 2010 01:32:37 -0000
- Subject: [Bug libc/11754] RFE: dlopen of ET_EXEC file
- References: <20100624232048.11754.jreiser@BitWagon.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From jreiser at BitWagon dot com 2010-06-25 01:32 -------
My application is an auditor (checker/verifier) and the target application
already has been built by someone else, usually without -fPIE -pie.
> "The usual handling for ET_EXEC files uses MAP_FIXED, which will clobber any
existing mappings."
Yes. However, instead of calling mmap(.p_vaddr,,,MAP_FIXED,,): omit the
MAP_FIXED, then compare the return value with .p_vaddr. If the two addresses
are equal, then the space was available and has been filled with the correct
contents. (As demonstrated by the test case, that is essentially the main
effect of calling dlopen on the original file but with .e_type=ET_DYN.) If the
return value from mmap does not equal .p_vaddr, then the pages weren't available
for some reason, and you get to decide what to do.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11754
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.