File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 48
48
static unsigned long module_load_offset ;
49
49
static int randomize_modules = 1 ;
50
50
51
+ /* Mutex protects the module_load_offset. */
52
+ static DEFINE_MUTEX (module_kaslr_mutex );
53
+
51
54
static int __init parse_nokaslr (char * p )
52
55
{
53
56
randomize_modules = 0 ;
@@ -58,7 +61,7 @@ early_param("nokaslr", parse_nokaslr);
58
61
static unsigned long int get_module_load_offset (void )
59
62
{
60
63
if (randomize_modules ) {
61
- mutex_lock (& module_mutex );
64
+ mutex_lock (& module_kaslr_mutex );
62
65
/*
63
66
* Calculate the module_load_offset the first time this
64
67
* code is called. Once calculated it stays the same until
@@ -67,7 +70,7 @@ static unsigned long int get_module_load_offset(void)
67
70
if (module_load_offset == 0 )
68
71
module_load_offset =
69
72
(get_random_int () % 1024 + 1 ) * PAGE_SIZE ;
70
- mutex_unlock (& module_mutex );
73
+ mutex_unlock (& module_kaslr_mutex );
71
74
}
72
75
return module_load_offset ;
73
76
}
You can’t perform that action at this time.
0 commit comments