linux/kernel/module
Hao Ge c79cf15eb3 module: fix lost error code from codetag_load_module()
If codetag_load_module() fails, err is not set to reflect the failure
and load_module() returns 0 after the module has been torn down.

Also, if the module is a livepatch, mod->klp_info allocated by
copy_module_elf() leaks on this error path.  Free it via a new
livepatch_cleanup label.

Link: https://lore.kernel.org/20260827030503.49171-1-hao.ge@linux.dev
Fixes: 044d2aee6c ("alloc_tag: handle module codetag load errors as module load failures")
Signed-off-by: Hao Ge <hao.ge@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Sashiko <sashiko-bot@kernel.org>
Suggested-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Cc: Aaron Tomlin <atomlin@atomlin.com>
Cc: Luis Chamberalin <mcgrof@kernel.org>
Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: <stable@vger.kernel.org>
2026-09-26 13:55:09 -07:00
..
debug_kmemleak.c
decompress.c module: decompress: check return value of module_extend_max_pages() 2026-06-04 16:37:32 +00:00
dups.c module/dups: Clean up includes 2026-08-06 13:29:03 +02:00
internal.h module: deprecate usage of *_gpl sections in module loader 2026-03-31 23:42:52 +00:00
kallsyms.c module/kallsyms: fix nextval for data symbol lookup 2026-08-06 13:27:35 +02:00
Kconfig module: Fix the modversions and signing submenus 2026-02-23 17:45:03 +00:00
kdb.c
kmod.c kernel: modules: Add SPDX license identifier to kmod.c 2026-01-15 16:58:28 -08:00
livepatch.c
main.c module: fix lost error code from codetag_load_module() 2026-09-26 13:55:09 -07:00
Makefile
procfs.c module: procfs: use matching type for accumulator in module_total_size() 2026-08-06 13:29:02 +02:00
signing.c module: Give MODULE_SIG_STRING a more descriptive name 2026-03-24 21:42:37 +00:00
stats.c module: use strscpy() to copy module names in stats and dup tracking 2026-08-06 13:29:02 +02:00
strict_rwx.c module: Make .static_call_sites read-only after init 2025-05-18 13:56:22 +02:00
sysfs.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tracking.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tree_lookup.c kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
version.c module: Use RCU in find_symbol(). 2025-03-10 11:54:44 +01:00