Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

module: s390: keep mod_arch_specific for livepatch modules

Livepatch needs to utilize the symbol information contained in the
mod_arch_specific struct in order to be able to call the s390
apply_relocate_add() function to apply relocations. Keep a reference to
syminfo if the module is a livepatch module. Remove the redundant vfree()
in module_finalize() since module_arch_freeing_init() (which also frees
those structures) is called in do_init_module(). If the module isn't a
livepatch module, we free the structures in module_arch_freeing_init() as
usual.

Signed-off-by: Jessica Yu <jeyu@redhat.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Jessica Yu and committed by
Jiri Kosina
f31e0960 1ce15ef4

+4 -2
+4 -2
arch/s390/kernel/module.c
··· 51 51 52 52 void module_arch_freeing_init(struct module *mod) 53 53 { 54 + if (is_livepatch_module(mod) && 55 + mod->state == MODULE_STATE_LIVE) 56 + return; 57 + 54 58 vfree(mod->arch.syminfo); 55 59 mod->arch.syminfo = NULL; 56 60 } ··· 429 425 struct module *me) 430 426 { 431 427 jump_label_apply_nops(me); 432 - vfree(me->arch.syminfo); 433 - me->arch.syminfo = NULL; 434 428 return 0; 435 429 }