]> git.karo-electronics.de Git - karo-tx-linux.git/commit
binfmt_elf: fix PIE execution with randomization disabled
authorJiri Kosina <jkosina@suse.cz>
Wed, 5 Oct 2011 00:43:41 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 6 Oct 2011 06:00:01 +0000 (17:00 +1100)
commitc5584c43d8877b6a90a3c32695c71b62865a4370
tree614bc077a143a1b7780d8d762274a4bfe49df56d
parentefa53df7ac01a076a27a7d7f9dbbcad778589dcb
binfmt_elf: fix PIE execution with randomization disabled

The case of address space randomization being disabled in runtime through
randomize_va_space sysctl is not treated properly in load_elf_binary(),
resulting in SIGKILL coming at exec() time for certain PIE-linked binaries
in case the randomization has been disabled at runtime prior to calling
exec().

Handle the randomize_va_space == 0 case the same way as if we were not
supporting .text randomization at all.

Based on original patch by H.J. Lu and Josh Boyer.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: H.J. Lu <hongjiu.lu@intel.com>
Cc: <stable@kernel.org>
Tested-by: Josh Boyer <jwboyer@redhat.com>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Andrew Morton <akpm@google.com>
fs/binfmt_elf.c