|
|
Log in / Subscribe / Register

How programs get run: ELF binaries

How programs get run: ELF binaries

Posted Feb 12, 2015 16:52 UTC (Thu) by nye (guest, #51576)
Parent article: How programs get run: ELF binaries

>An empty page may also be mapped at the zero address in the program's address
>space for backward-compatibility reasons (old SVr4 programs apparently assume
>that reading from a NULL pointer would return zeros rather than SIGSEGV).

I have an instinctive reaction that this sort of behaviour should have to be explicitly enabled via sysctl or something - it seems to violate the principle of least astonishment in a way that could have surprising implications, including security ones.

Am I way off base here? Certainly I am working from a position of abject ignorance.


to post comments

How programs get run: ELF binaries

Posted Feb 12, 2015 17:20 UTC (Thu) by drysdale (guest, #95971) [Link]

That behaviour does need to be explicitly enabled via the personality() syscall; of the pre-defined personality values, only PER_SRV4 and PER_UW7 set the MMAP_PAGE_ZERO bit that controls this behaviour. (The bit is also explicitly cleared when running a setuid/setgid binary.)


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds