aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authordcashman <dcashman@google.com>2015-12-29 14:24:39 -0800
committerZiyan <jaraidaniel@gmail.com>2016-10-29 01:33:53 +0200
commit56ec74e215e7eed1634e82cdc2bec5e28422808a (patch)
tree7e88d04f15a37216bc7fc7ecc628d31acf29e6fe /kernel
parentb37549b9638e3d702eb6cd28e83767cccb4d164a (diff)
downloadkernel_samsung_tuna-56ec74e215e7eed1634e82cdc2bec5e28422808a.zip
kernel_samsung_tuna-56ec74e215e7eed1634e82cdc2bec5e28422808a.tar.gz
kernel_samsung_tuna-56ec74e215e7eed1634e82cdc2bec5e28422808a.tar.bz2
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: Ic74424e07710cd9ccb4a02871a829d14ef0cc4bc
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sysctl.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index f5284d2..ebf8811 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1369,6 +1369,28 @@ static struct ctl_table vm_table[] = {
.extra2 = &one,
},
#endif
+#ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS
+ {
+ .procname = "mmap_rnd_bits",
+ .data = &mmap_rnd_bits,
+ .maxlen = sizeof(mmap_rnd_bits),
+ .mode = 0600,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = (void *)&mmap_rnd_bits_min,
+ .extra2 = (void *)&mmap_rnd_bits_max,
+ },
+#endif
+#ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS
+ {
+ .procname = "mmap_rnd_compat_bits",
+ .data = &mmap_rnd_compat_bits,
+ .maxlen = sizeof(mmap_rnd_compat_bits),
+ .mode = 0600,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = (void *)&mmap_rnd_compat_bits_min,
+ .extra2 = (void *)&mmap_rnd_compat_bits_max,
+ },
+#endif
{ }
};