FROMLIST: arm: mm: support ARCH_MMAP_RND_BITS.

(cherry picked from commit

arm: arch_mmap_rnd() uses a hard-code value of 8 to generate the
random offset for the mmap base address.  This value represents a
compromise between increased ASLR effectiveness and avoiding
address-space fragmentation. Replace it with a Kconfig option, which
is sensibly bounded, so that platform developers may choose where to
place this compromise. Keep 8 as the minimum acceptable value.

Signed-off-by: Daniel Cashman <>
Signed-off-by: Daniel Cashman <>

Bug: 27796957
Patchset: ASLR sysctl

Change-Id: Ia3c4bf2e765662fa3f600e1b626ac1543b0f0149
Signed-off-by: Kees Cook <>
2 files changed