Skip to content

Commit 4d10380

Browse files
Jan Glauberrustyrussell
authored andcommitted
module: zero mod->init_ro_size after init is freed.
Reset mod->init_ro_size to zero after the init part of a module is unloaded. Otherwise we need to check if module->init is NULL in the unprotect functions in the next patch. Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 5d05c70 commit 4d10380

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎kernel/module.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2935,6 +2935,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
29352935
module_free(mod, mod->module_init);
29362936
mod->module_init = NULL;
29372937
mod->init_size = 0;
2938+
mod->init_ro_size = 0;
29382939
mod->init_text_size = 0;
29392940
mutex_unlock(&module_mutex);
29402941

0 commit comments

Comments
 (0)