Thread (9 messages) flat view 9 messages, 6 authors, 12d ago
COOLING12d

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

From: Hao Ge <hao.ge@linux.dev>
Date: 2026-08-24 01:47:17
Also in: lkml, stable
Subsystem: module support, the rest · Maintainers: Luis Chamberlain, Petr Pavlu, Daniel Gomez, Sami Tolvanen, Linus Torvalds

If codetag_load_module() fails, err is never set and load_module()
returns 0 after the module has been torn down.

Fixes: 044d2aee6c57 ("alloc_tag: handle module codetag load errors as module load failures")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Hao Ge <hao.ge@linux.dev>
---
 kernel/module/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/module/main.c b/kernel/module/main.c
index 46dd8d25a605..afb810f0154c 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -3568,7 +3568,8 @@ static int load_module(struct load_info *info, const char __user *uargs,
 			goto sysfs_cleanup;
 	}
 
-	if (codetag_load_module(mod))
+	err = codetag_load_module(mod);
+	if (err)
 		goto sysfs_cleanup;
 
 	/* Get rid of temporary copy. */
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help