]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blobdiff - arch/x86/kernel/module.c
x86/mm/ASLR: Propagate base load address calculation
[mirror_ubuntu-eoan-kernel.git] / arch / x86 / kernel / module.c
index e69f9882bf95a942ae1ce0f75efbf07301c9adc3..c3c59a3a14adb186b9bf5a54f1c11f45a055a39e 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <asm/page.h>
 #include <asm/pgtable.h>
+#include <asm/page_types.h>
 
 #if 0
 #define DEBUGP(fmt, ...)                               \
@@ -46,21 +47,13 @@ do {                                                        \
 
 #ifdef CONFIG_RANDOMIZE_BASE
 static unsigned long module_load_offset;
-static int randomize_modules = 1;
 
 /* Mutex protects the module_load_offset. */
 static DEFINE_MUTEX(module_kaslr_mutex);
 
-static int __init parse_nokaslr(char *p)
-{
-       randomize_modules = 0;
-       return 0;
-}
-early_param("nokaslr", parse_nokaslr);
-
 static unsigned long int get_module_load_offset(void)
 {
-       if (randomize_modules) {
+       if (kaslr_enabled) {
                mutex_lock(&module_kaslr_mutex);
                /*
                 * Calculate the module_load_offset the first time this