From: "Chris Friesen" <cfriesen@nortel.com>
To: linux-kernel@vger.kernel.org, Andi Kleen <ak@suse.de>,
Andrew Morton <akpm@osdl.org>,
James Bottomley <James.Bottomley@steeleye.com>,
bapper@piratehaven.org, aaw@google.com
Subject: RFC: bug in load_elf_binary?
Date: Wed, 12 Sep 2007 12:36:01 -0600 [thread overview]
Message-ID: <46E83191.5070208@nortel.com> (raw)
In-Reply-To: <46E5B6FA.7000902@nortel.com>
No responses in a couple days so I'm resending. I've CC'd a few people
who've touched binfmt_elf.c recently.
We've got an unusual elf binary and we seem to be running into a bug in
the elf loader. I'm not an elf expert, so my apologies if I get the
terminology wrong.
The elf spec says that PT_LOAD segments must be ordered by vaddr. We
want to have a segment at a relatively low fixed vaddr. The exact
address is not important, except that it's lower than the standard elf
headers and so it must be the first segment in the elf file.
However, this segment also has no size in the file...it's basically all
statically allocated at runtime.
In the kernel elf loader, the p_vaddr and p_offset of the first segment
are used to determine the load_addr for use with the rest of the
segments. In the case of this elf file, the first segment does not
actually have a valid p_offset.
Anyone have any suggestions on how to deal with this? One crude hack we
considered was to simply not set the load_addr if the first segment
doesn't have a valid p_offset, but that doesn't solve the general case.
Thanks,
Chris
next prev parent reply other threads:[~2007-09-12 18:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-10 21:28 RFC: possible bug in load_elf_binary Chris Friesen
2007-09-12 18:36 ` Chris Friesen [this message]
2007-09-13 22:00 ` RFC: bug in load_elf_binary? Jeremy Fitzhardinge
2007-09-13 23:25 ` Chris Friesen
2007-09-14 18:21 ` Jeremy Fitzhardinge
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=46E83191.5070208@nortel.com \
--to=cfriesen@nortel.com \
--cc=James.Bottomley@steeleye.com \
--cc=aaw@google.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=bapper@piratehaven.org \
--cc=linux-kernel@vger.kernel.org \
/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