xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Brad Plant <bplant@iinet.net.au>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: pageexec@freemail.hu
Subject: is_loadable_phdr
Date: Fri, 29 Jan 2010 06:55:09 +1100	[thread overview]
Message-ID: <20100129065509.0dba48bc@daedalus> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 941 bytes --]

Hi,

I'm attempting to boot the latest mainline kernel patched with PaX. The PaX patch marks some segments as read-only (R--) which is resulting in these segments not being loaded due to is_loadable_phdr returning zero for read-only segments:

int elf_phdr_is_loadable(struct elf_binary *elf, const elf_phdr * phdr)
{
	uint64_t p_type = elf_uval(elf, phdr, p_type);
	uint64_t p_flags = elf_uval(elf, phdr, p_flags);

	return ((p_type == PT_LOAD) && (p_flags & (PF_W | PF_X)) != 0);
}

I'm trying to get an understanding of why a segment has to be writeable or executable for xen to load it. Does anyone know why this is so?

Also, is it likely that this behaviour could be changed? My understanding is that it's perfectly valid to have an ELF kernel with read-only segments in it. Attempting to use an image with a read-only segment leads to the kernel failing to boot with weird and hard to debug crashes.

Cheers,

Brad

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2010-01-28 19:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-28 19:55 Brad Plant [this message]
2010-01-28 21:14 ` is_loadable_phdr Keir Fraser
2010-01-28 22:02   ` is_loadable_phdr Brad Plant

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=20100129065509.0dba48bc@daedalus \
    --to=bplant@iinet.net.au \
    --cc=pageexec@freemail.hu \
    --cc=xen-devel@lists.xensource.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 NNTP newsgroup(s).