pie-executable-randomization
commit71dbb68435a8f95b80ec646ae7184856f96d9074
authorJiri Kosina <jkosina@suse.cz>
Sat, 10 Nov 2007 22:25:33 +0000 (10 22:25 +0000)
committerMatthias Urlichs <smurf@hera.kernel.org>
Wed, 14 Nov 2007 11:28:45 +0000 (14 11:28 +0000)
treeaaf451c27ffe0f3582c89b4d28936f33eea6d6f8
parenta309921553f8901c928ae7ac1cfc64d18a56a7c3
pie-executable-randomization

Use mmap()'s randomization functionality in such a way that it maps the
main executable of (specially compiled/linked -pie/-fpie) ET_DYN binaries
onto a random address (in cases in which mmap() is allowed to perform a
randomization).

The code has been extraced from Ingo's exec-shield patch
http://people.redhat.com/mingo/exec-shield/

[akpm@linux-foundation.org: fix used-uninitialsied warning]
[kamezawa.hiroyu@jp.fujitsu.com: fixed ia32 ELF on x86_64 handling]
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Roland McGrath <roland@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/ia64/ia32/binfmt_elf32.c
arch/x86/kernel/sys_x86_64.c
arch/x86/mm/mmap_64.c
fs/binfmt_elf.c
include/asm-x86/pgtable_64.h