Re: [PATCH v2] module: fix lost error code from codetag_load_module()

From: Daniel Gomez

Date: Mon Sep 07 2026 - 15:46:27 EST




On 2026-08-27T11:05:03+08:00, Hao Ge <hao.ge@xxxxxxxxx> wrote:
> 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.
>
> Fixes: 044d2aee6c57 ("alloc_tag: handle module codetag load errors as module load failures")
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Suggested-by: Petr Pavlu <petr.pavlu@xxxxxxxx>
> Reviewed-by: Bradley Morgan <brads@xxxxxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Hao Ge <hao.ge@xxxxxxxxx>

We need the unwind from codetag_unload_module() as reported by sashiko.

With that,

Reviewed-by: Daniel Gomez <da.gomez@xxxxxxxxxxx>