Linux Modules
 help / color / mirror / Atom feed
From: Bradley Morgan <brads@mainlining.org>
To: hao.ge@linux.dev
Cc: akpm@linux-foundation.org, atomlin@atomlin.com,
	da.gomez@kernel.org, linux-kernel@vger.kernel.org,
	linux-modules@vger.kernel.org, mcgrof@kernel.org,
	petr.pavlu@suse.com, samitolvanen@google.com,
	sashiko-bot@kernel.org, stable@vger.kernel.org,
	surenb@google.com
Subject: Re: [PATCH] module: fix lost error code from codetag_load_module()
Date: Tue, 25 Aug 2026 20:36:31 +0100	[thread overview]
Message-ID: <93AACC24-3583-4433-96F9-D1A2E87DC15C@mainlining.org> (raw)
In-Reply-To: <20260824014736.35026-1-hao.ge@linux.dev>

On 24 August 2026 02:47:36 BST, Hao Ge <hao.ge@linux.dev> wrote:
>If codetag_load_module() fails, err is never set and load_module()
>returns 0 after the module has been torn down.
>

I see!

>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

Reviewed-by: Bradley Morgan <brads@mainlining.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)

Nice!

> 		goto sysfs_cleanup;
> 
> 	/* Get rid of temporary copy. */
>

--- Thanks!
https://lore.kernel.org/all/EE579805-42F2-4C58-B752-F28779EEB717@grrlz.net/

  parent reply	other threads:[~2026-08-25 19:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24  1:47 [PATCH] module: fix lost error code from codetag_load_module() Hao Ge
2026-08-24  2:03 ` sashiko-bot
2026-08-24 16:26 ` Suren Baghdasaryan
2026-08-25  8:54 ` Aaron Tomlin
2026-08-25 19:36 ` Bradley Morgan [this message]
2026-08-26  9:24 ` Petr Pavlu
2026-08-27  0:11   ` Suren Baghdasaryan
2026-08-27  0:23   ` Bradley Morgan
2026-08-27  3:15   ` Hao Ge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93AACC24-3583-4433-96F9-D1A2E87DC15C@mainlining.org \
    --to=brads@mainlining.org \
    --cc=akpm@linux-foundation.org \
    --cc=atomlin@atomlin.com \
    --cc=da.gomez@kernel.org \
    --cc=hao.ge@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=samitolvanen@google.com \
    --cc=sashiko-bot@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=surenb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox