From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brad Plant Subject: is_loadable_phdr Date: Fri, 29 Jan 2010 06:55:09 +1100 Message-ID: <20100129065509.0dba48bc@daedalus> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0140505347==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" Cc: pageexec@freemail.hu List-Id: xen-devel@lists.xenproject.org --===============0140505347== Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/1k9UncQSorJ0+u6Sd1oGoXk"; protocol="application/pgp-signature" --Sig_/1k9UncQSorJ0+u6Sd1oGoXk Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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 s= egments not being loaded due to is_loadable_phdr returning zero for read-on= ly segments: int elf_phdr_is_loadable(struct elf_binary *elf, const elf_phdr * phdr) { uint64_t p_type =3D elf_uval(elf, phdr, p_type); uint64_t p_flags =3D elf_uval(elf, phdr, p_flags); return ((p_type =3D=3D PT_LOAD) && (p_flags & (PF_W | PF_X)) !=3D 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 i= s that it's perfectly valid to have an ELF kernel with read-only segments i= n it. Attempting to use an image with a read-only segment leads to the kern= el failing to boot with weird and hard to debug crashes. Cheers, Brad --Sig_/1k9UncQSorJ0+u6Sd1oGoXk Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkth650ACgkQtFxK98yAy+mAwQCfUbE0REzq0keupjYK1ky7DxNP B7kAnjKI4FJs39UrPhmzCMw3vk5JRXtE =vq/l -----END PGP SIGNATURE----- --Sig_/1k9UncQSorJ0+u6Sd1oGoXk-- --===============0140505347== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0140505347==--