public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jreiser at BitWagon dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/11754] RFE: dlopen of ET_EXEC file
Date: Fri, 25 Jun 2010 01:32:00 -0000	[thread overview]
Message-ID: <20100625013237.8633.qmail@sourceware.org> (raw)
In-Reply-To: <20100624232048.11754.jreiser@BitWagon.com>


------- 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.


  parent reply	other threads:[~2010-06-25  1:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24 23:21 [Bug libc/11754] New: " jreiser at BitWagon dot com
2010-06-24 23:24 ` [Bug libc/11754] " roland at gnu dot org
2010-06-25  1:32 ` jreiser at BitWagon dot com [this message]
2010-06-25  2:27 ` jreiser at BitWagon dot com
2010-06-29 17:36 ` jreiser at BitWagon dot com
2010-06-29 17:38 ` jreiser at BitWagon dot com
2010-09-21 14:17 ` pasky at suse dot cz
2010-09-21 16:55 ` jreiser at BitWagon dot com
2010-10-04  2:49 ` drepper dot fsp at gmail dot com
2010-10-04 15:42 ` jreiser at BitWagon dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100625013237.8633.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).