x86: standardize mmap_rnd() usage
authorKees Cook <keescook@chromium.org>
Tue, 14 Apr 2015 22:47:45 +0000 (15:47 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 30 Apr 2016 22:05:23 +0000 (00:05 +0200)
commit333d0cf28913c5d52dc7a15d0f0a4c1444f67632
tree89c7c67a505bed32a8477cd1c5aeb7d0f34f3260
parentb8cea33c6279e43cf0a222f3709f54e7d7c5a9be
x86: standardize mmap_rnd() usage

commit 82168140bc4cec7ec9bad39705518541149ff8b7 upstream.

In preparation for splitting out ET_DYN ASLR, this refactors the use of
mmap_rnd() to be used similarly to arm, and extracts the checking of
PF_RANDOMIZE.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/x86/mm/mmap.c