Skip to content

Commit d8fbc1b

Browse files
zq-david-wangKPD
authored andcommitted
module: release codetag section when module load fails
When module load fails after memory for codetag section is ready, codetag section memory will not be properly released. This causes memory leak, and if next module load happens to get the same module address, codetag may pick the uninitialized section when manipulating tags during module unload, and leads to "unable to handle page fault" BUG. Closes: https://lore.kernel.org/all/20250516131246.6244-1-00107082@163.com/ Signed-off-by: David Wang <00107082@163.com> Acked-by: Suren Baghdasaryan <surenb@google.com>
1 parent b788ac1 commit d8fbc1b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/module/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2816,6 +2816,7 @@ static void module_deallocate(struct module *mod, struct load_info *info)
28162816
{
28172817
percpu_modfree(mod);
28182818
module_arch_freeing_init(mod);
2819+
codetag_free_module_sections(mod);
28192820

28202821
free_mod_mem(mod);
28212822
}

0 commit comments

Comments
 (0)