aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-02-06 16:39:44 -0500
committerIngo Molnar <mingo@elte.hu>2008-02-06 16:39:44 -0500
commit32a932332c8bad842804842eaf9651ad6268e637 (patch)
tree58f187409029f089f788c5c35ad5c200b4a555af /mm
parent4cc6028d4040f95cdb590a87db478b42b8be0508 (diff)
brk randomization: introduce CONFIG_COMPAT_BRK
based on similar patch from: Pavel Machek <pavel@ucw.cz> Introduce CONFIG_COMPAT_BRK. If disabled then the kernel is free (but not obliged to) randomize the brk area. Heap randomization breaks ancient binaries, so we keep COMPAT_BRK enabled by default. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 7bb70728bb52..9d073fa0a2d0 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -82,7 +82,18 @@ void * high_memory;
82EXPORT_SYMBOL(num_physpages); 82EXPORT_SYMBOL(num_physpages);
83EXPORT_SYMBOL(high_memory); 83EXPORT_SYMBOL(high_memory);
84 84
85int randomize_va_space __read_mostly = 1; 85/*
86 * Randomize the address space (stacks, mmaps, brk, etc.).
87 *
88 * ( When CONFIG_COMPAT_BRK=y we exclude brk from randomization,
89 * as ancient (libc5 based) binaries can segfault. )
90 */
91int randomize_va_space __read_mostly =
92#ifdef CONFIG_COMPAT_BRK
93 1;
94#else
95 2;
96#endif
86 97
87static int __init disable_randmaps(char *s) 98static int __init disable_randmaps(char *s)
88{ 99{