From 818bcba580bbe96829fe776de526125205eb8c8b Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Fri, 4 Mar 2005 17:24:30 -0800 Subject: [PATCH] Randomisation: global sysctl This first patch of the series introduces a sysctl (default off) that enables/disables the randomisation feature globally. Since randomisation may make it harder to debug really tricky situations (reproducability goes down), the sysadmin needs a way to disable it globally. Signed-off-by: Arjan van de Ven Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/kernel.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux/kernel.h') diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 806491a0ab59..797d24c48a99 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -278,6 +278,12 @@ struct sysinfo { extern void BUILD_BUG(void); #define BUILD_BUG_ON(condition) do { if (condition) BUILD_BUG(); } while(0) +#ifdef CONFIG_SYSCTL +extern int randomize_va_space; +#else +#define randomize_va_space 0 +#endif + /* Trap pasters of __FUNCTION__ at compile-time */ #if __GNUC__ > 2 || __GNUC_MINOR__ >= 95 #define __FUNCTION__ (__func__) -- cgit v1.2.3 From 3f06ae033fc51fd6163445f7bee505f0095404ec Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Fri, 4 Mar 2005 17:25:41 -0800 Subject: [PATCH] Randomisation: enable by default Signed-off-by: Arjan van de Ven Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/kernel.h | 2 +- kernel/sysctl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include/linux/kernel.h') diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 797d24c48a99..de56b8b26cd5 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -281,7 +281,7 @@ extern void BUILD_BUG(void); #ifdef CONFIG_SYSCTL extern int randomize_va_space; #else -#define randomize_va_space 0 +#define randomize_va_space 1 #endif /* Trap pasters of __FUNCTION__ at compile-time */ diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 3f6b3fcf4309..cc93403f27a7 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -121,7 +121,7 @@ extern int sysctl_hz_timer; extern int acct_parm[]; #endif -int randomize_va_space; +int randomize_va_space = 1; static int parse_table(int __user *, int, void __user *, size_t __user *, void __user *, size_t, ctl_table *, void **); -- cgit v1.2.3