Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

binfmt_elf: PIE: make PF_RANDOMIZE check comment more accurate

The comment I originally added in commit a3defbe5c337 ("binfmt_elf: fix
PIE execution with randomization disabled") is not really 100% accurate
-- sysctl is not the only way how PF_RANDOMIZE could be forcibly unset
in runtime.

Another option of course is direct modification of personality flags
(i.e. running through setarch wrapper).

Make the comment more explicit and accurate.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jiri Kosina and committed by
Linus Torvalds
c1d025e2 2535e0d7

+2 -1
+2 -1
fs/binfmt_elf.c
··· 803 803 * follow the loader, and is not movable. */ 804 804 #ifdef CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE 805 805 /* Memory randomization might have been switched off 806 - * in runtime via sysctl. 806 + * in runtime via sysctl or explicit setting of 807 + * personality flags. 807 808 * If that is the case, retain the original non-zero 808 809 * load_bias value in order to establish proper 809 810 * non-randomized mappings.