diff options
Diffstat (limited to 'arch/x86/kernel/module.c')
-rw-r--r-- | arch/x86/kernel/module.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c index e69f9882bf95..c3c59a3a14ad 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c | |||
@@ -32,6 +32,7 @@ | |||
32 | 32 | ||
33 | #include <asm/page.h> | 33 | #include <asm/page.h> |
34 | #include <asm/pgtable.h> | 34 | #include <asm/pgtable.h> |
35 | #include <asm/page_types.h> | ||
35 | 36 | ||
36 | #if 0 | 37 | #if 0 |
37 | #define DEBUGP(fmt, ...) \ | 38 | #define DEBUGP(fmt, ...) \ |
@@ -46,21 +47,13 @@ do { \ | |||
46 | 47 | ||
47 | #ifdef CONFIG_RANDOMIZE_BASE | 48 | #ifdef CONFIG_RANDOMIZE_BASE |
48 | static unsigned long module_load_offset; | 49 | static unsigned long module_load_offset; |
49 | static int randomize_modules = 1; | ||
50 | 50 | ||
51 | /* Mutex protects the module_load_offset. */ | 51 | /* Mutex protects the module_load_offset. */ |
52 | static DEFINE_MUTEX(module_kaslr_mutex); | 52 | static DEFINE_MUTEX(module_kaslr_mutex); |
53 | 53 | ||
54 | static int __init parse_nokaslr(char *p) | ||
55 | { | ||
56 | randomize_modules = 0; | ||
57 | return 0; | ||
58 | } | ||
59 | early_param("nokaslr", parse_nokaslr); | ||
60 | |||
61 | static unsigned long int get_module_load_offset(void) | 54 | static unsigned long int get_module_load_offset(void) |
62 | { | 55 | { |
63 | if (randomize_modules) { | 56 | if (kaslr_enabled) { |
64 | mutex_lock(&module_kaslr_mutex); | 57 | mutex_lock(&module_kaslr_mutex); |
65 | /* | 58 | /* |
66 | * Calculate the module_load_offset the first time this | 59 | * Calculate the module_load_offset the first time this |