Executing from readablee, no-exec pages

Rodrigo Rubira Branco rrbranco at br.ibm.com
Fri Jul 6 08:38:55 EST 2007


On Thu, 2007-07-05 at 16:55 -0500, Scott Wood wrote:
> As revealed by the recent "Prevent data exception in kernel space" 
> patch, versions of glibc prior to 2.4[1] assume that, on powerpc32, they 
> can execute out of any readable mapping, regardless of whether it is 
> marked for execution.  This happens in the elf_machine_load_address() 
> function.
> 
> To maintain compatibility with these versions, we could change the test 
> in do_page_fault() to include VM_READ as well as VM_EXEC on targets that 
> don't have a separate exec-bit in hardware (are there any powerpc mmus 
> that do?).  However, Segher suggested on IRC that we may want to drop 
> compatibility with those old versions of glibc, and that I should seek 
> your input.
> 
> Personally, I'd rather stick the VM_READ in there, partially for selfish 
> reasons (our root filesystems are based on older glibcs), and because it 
> seems a little too soon to deprecate glibc 2.3, but also because in the 
> absence of hardware support, the VM_EXEC check will be nondeterministic, 
> kicking in only when the first fault for a page is to execute.
> 
> -Scott
> 
> [1] It's possible that there are other instances of this in 2.4 and that 
> the actual version is newer; I ran into obnoxious cross compilation 
> issues trying to try it.  However,
> 
> <rant>
> Glibc already has target-specific code/headers; if you need to know 
> something that you'd otherwise need a runs-on-the-target autoconf test 
> for, why not just stick it in such a target-specific header?  In this 
> case, it was trying to figure out the size of "long double".
> </rant>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

Since may be a security problem (non-exec mappings being executed), I
really believe we don't want to keep the compatibility.


Regards,


Rodrigo (BSDaemon).

-- 
Rodrigo Rubira Branco
Software Engineer 
Advanced Linux Response Team (ALRT) / Linux on Power Toolchain
IBM Linux Technology Center (IBM/LTC)
rrbranco at br.ibm.com

GPG KeyID: 1FCEDEA1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070705/556a83f0/attachment.pgp>


More information about the Linuxppc-dev mailing list