From 02c1e8f7fda1f66143ed2b9acfae7ab8cfc69f3c Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Thu, 16 Feb 2006 23:41:58 +0100 Subject: [PATCH] --- yaml --- r: 20418 b: refs/heads/master c: a62eaf151d9cb478d127cfbc2e93c498869785b0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/kernel-parameters.txt | 3 +++ trunk/arch/i386/kernel/cpu/transmeta.c | 1 + trunk/include/linux/kernel.h | 6 ------ trunk/include/linux/mm.h | 2 ++ trunk/kernel/sysctl.c | 2 -- trunk/mm/memory.c | 10 ++++++++++ 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index b9f368c1de25..7f52bcc60b1b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 99019e919969be88e7e4042f3afa296bd55ad9ec +refs/heads/master: a62eaf151d9cb478d127cfbc2e93c498869785b0 diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt index ac75b57edf2e..b874771385cd 100644 --- a/trunk/Documentation/kernel-parameters.txt +++ b/trunk/Documentation/kernel-parameters.txt @@ -1638,6 +1638,9 @@ running once the system is up. Format: ,,,,,[,[,[,]]] + norandmaps Don't use address space randomization + Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space + ______________________________________________________________________ Changelog: diff --git a/trunk/arch/i386/kernel/cpu/transmeta.c b/trunk/arch/i386/kernel/cpu/transmeta.c index bdbeb77f4e22..7214c9b577ab 100644 --- a/trunk/arch/i386/kernel/cpu/transmeta.c +++ b/trunk/arch/i386/kernel/cpu/transmeta.c @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/trunk/include/linux/kernel.h b/trunk/include/linux/kernel.h index b49affa0ac5a..3b507bf05d09 100644 --- a/trunk/include/linux/kernel.h +++ b/trunk/include/linux/kernel.h @@ -326,12 +326,6 @@ struct sysinfo { /* Force a compilation error if condition is true */ #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) -#ifdef CONFIG_SYSCTL -extern int randomize_va_space; -#else -#define randomize_va_space 1 -#endif - /* Trap pasters of __FUNCTION__ at compile-time */ #define __FUNCTION__ (__func__) diff --git a/trunk/include/linux/mm.h b/trunk/include/linux/mm.h index 75e9f0724997..26e1663a5cbe 100644 --- a/trunk/include/linux/mm.h +++ b/trunk/include/linux/mm.h @@ -1051,5 +1051,7 @@ int shrink_slab(unsigned long scanned, gfp_t gfp_mask, void drop_pagecache(void); void drop_slab(void); +extern int randomize_va_space; + #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ diff --git a/trunk/kernel/sysctl.c b/trunk/kernel/sysctl.c index 71dd6f62efec..7654d55c47f5 100644 --- a/trunk/kernel/sysctl.c +++ b/trunk/kernel/sysctl.c @@ -126,8 +126,6 @@ extern int sysctl_hz_timer; extern int acct_parm[]; #endif -int randomize_va_space = 1; - static int parse_table(int __user *, int, void __user *, size_t __user *, void __user *, size_t, ctl_table *, void **); static int proc_doutsstring(ctl_table *table, int write, struct file *filp, diff --git a/trunk/mm/memory.c b/trunk/mm/memory.c index 2bee1f21aa8a..9abc6008544b 100644 --- a/trunk/mm/memory.c +++ b/trunk/mm/memory.c @@ -82,6 +82,16 @@ EXPORT_SYMBOL(num_physpages); EXPORT_SYMBOL(high_memory); EXPORT_SYMBOL(vmalloc_earlyreserve); +int randomize_va_space __read_mostly = 1; + +static int __init disable_randmaps(char *s) +{ + randomize_va_space = 0; + return 0; +} +__setup("norandmaps", disable_randmaps); + + /* * If a p?d_bad entry is found while walking page tables, report * the error, before resetting entry to p?d_none. Usually (but