aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordcashman <dcashman@google.com>2016-01-12 09:18:57 -0800
committerdcashman <dcashman@google.com>2016-01-12 09:20:39 -0800
commited0ff596bcaa39aad363b4eef2c77814f241361e (patch)
tree9be1932ad14c4e17985212d1c74dd9ff0beb5832 /include
parentc85d30ec377a519645dac14c7595e3883ed6edf7 (diff)
downloadhikey-linaro-ed0ff596bcaa39aad363b4eef2c77814f241361e.tar.gz
FROMLIST: mm: mmap: Add new /proc tunable for mmap_base ASLR.
(cherry picked from commit https://lkml.org/lkml/2015/12/21/337) ASLR only uses as few as 8 bits to generate the random offset for the mmap base address on 32 bit architectures. This value was chosen to prevent a poorly chosen value from dividing the address space in such a way as to prevent large allocations. This may not be an issue on all platforms. Allow the specification of a minimum number of bits so that platforms desiring greater ASLR protection may determine where to place the trade-off. Bug: 24047224 Signed-off-by: Daniel Cashman <dcashman@android.com> Signed-off-by: Daniel Cashman <dcashman@google.com> Change-Id: Ibf9ed3d4390e9686f5cc34f605d509a20d40e6c2
Diffstat (limited to 'include')
-rw-r--r--include/linux/mm.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index d57fe6c627c1..b1b7c8bebbd6 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -49,6 +49,17 @@ extern int sysctl_legacy_va_layout;
#define sysctl_legacy_va_layout 0
#endif
+#ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS
+extern const int mmap_rnd_bits_min;
+extern const int mmap_rnd_bits_max;
+extern int mmap_rnd_bits __read_mostly;
+#endif
+#ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS
+extern const int mmap_rnd_compat_bits_min;
+extern const int mmap_rnd_compat_bits_max;
+extern int mmap_rnd_compat_bits __read_mostly;
+#endif
+
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/processor.h>