diff options
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/kernel/module.c b/kernel/module.c index 562f665c721f..34e00b708fad 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -2816,18 +2816,6 @@ static struct module *load_module(void __user *umod, | |||
2816 | kfree(info.strmap); | 2816 | kfree(info.strmap); |
2817 | free_copy(&info); | 2817 | free_copy(&info); |
2818 | 2818 | ||
2819 | /* Set RO and NX regions for core */ | ||
2820 | set_section_ro_nx(mod->module_core, | ||
2821 | mod->core_text_size, | ||
2822 | mod->core_ro_size, | ||
2823 | mod->core_size); | ||
2824 | |||
2825 | /* Set RO and NX regions for init */ | ||
2826 | set_section_ro_nx(mod->module_init, | ||
2827 | mod->init_text_size, | ||
2828 | mod->init_ro_size, | ||
2829 | mod->init_size); | ||
2830 | |||
2831 | /* Done! */ | 2819 | /* Done! */ |
2832 | trace_module_load(mod); | 2820 | trace_module_load(mod); |
2833 | return mod; | 2821 | return mod; |
@@ -2888,6 +2876,18 @@ SYSCALL_DEFINE3(init_module, void __user *, umod, | |||
2888 | blocking_notifier_call_chain(&module_notify_list, | 2876 | blocking_notifier_call_chain(&module_notify_list, |
2889 | MODULE_STATE_COMING, mod); | 2877 | MODULE_STATE_COMING, mod); |
2890 | 2878 | ||
2879 | /* Set RO and NX regions for core */ | ||
2880 | set_section_ro_nx(mod->module_core, | ||
2881 | mod->core_text_size, | ||
2882 | mod->core_ro_size, | ||
2883 | mod->core_size); | ||
2884 | |||
2885 | /* Set RO and NX regions for init */ | ||
2886 | set_section_ro_nx(mod->module_init, | ||
2887 | mod->init_text_size, | ||
2888 | mod->init_ro_size, | ||
2889 | mod->init_size); | ||
2890 | |||
2891 | do_mod_ctors(mod); | 2891 | do_mod_ctors(mod); |
2892 | /* Start the module */ | 2892 | /* Start the module */ |
2893 | if (mod->init != NULL) | 2893 | if (mod->init != NULL) |