From: Daniel Gomez <da.gomez@kernel.org>
To: Petr Pavlu <petr.pavlu@suse.com>,
Luis Chamberlain <mcgrof@kernel.org>,
Sami Tolvanen <samitolvanen@google.com>,
Daniel Gomez <da.gomez@samsung.com>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>
Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] tracing: Replace MAX_PARAM_PREFIX_LEN with MODULE_NAME_LEN
Date: Mon, 28 Jul 2025 08:48:01 +0200 [thread overview]
Message-ID: <e9caf91d-3a4b-4140-a3bc-0c2b53c0a220@kernel.org> (raw)
In-Reply-To: <20250630143535.267745-5-petr.pavlu@suse.com>
On 30/06/2025 16.32, Petr Pavlu wrote:
> Use the MODULE_NAME_LEN definition in module_exists() to obtain the maximum
> size of a module name, instead of using MAX_PARAM_PREFIX_LEN. The values
> are the same but MODULE_NAME_LEN is more appropriate in this context.
> MAX_PARAM_PREFIX_LEN was added in commit 730b69d22525 ("module: check
> kernel param length at compile time, not runtime") only to break a circular
> dependency between module.h and moduleparam.h, and should mostly be limited
> to use in moduleparam.h.
>
> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Masami Hiramatsu <mhiramat@kernel.org>
Steven, Masami,
I'm planning to merge these series into modules-next. I think and Ack/Review
would be great from you. Otherwise, let me know if you'd rather take this patch
through tracing instead (in case it looks good from your side).
> ---
>
> As a side note, I suspect the function module_exists() would be better
> replaced with !!find_module() + RCU locking, but that is a separate issue.
>
> kernel/trace/trace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 95ae7c4e5835..b9da0c4661a0 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -10373,7 +10373,7 @@ bool module_exists(const char *module)
> {
> /* All modules have the symbol __this_module */
> static const char this_mod[] = "__this_module";
> - char modname[MAX_PARAM_PREFIX_LEN + sizeof(this_mod) + 2];
> + char modname[MODULE_NAME_LEN + sizeof(this_mod) + 2];
> unsigned long val;
> int n;
>
LGTM,
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
next prev parent reply other threads:[~2025-07-28 6:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-30 14:32 [PATCH 0/5] module: Fix minor problems related to MODULE_NAME_LEN Petr Pavlu
2025-06-30 14:32 ` [PATCH 1/5] module: Prevent silent truncation of module name in delete_module(2) Petr Pavlu
2025-07-16 19:47 ` Daniel Gomez
2025-06-30 14:32 ` [PATCH 2/5] module: Remove unnecessary +1 from last_unloaded_module::name size Petr Pavlu
2025-07-16 19:49 ` Daniel Gomez
2025-06-30 14:32 ` [PATCH 3/5] module: Restore the moduleparam prefix length check Petr Pavlu
2025-07-17 19:23 ` Daniel Gomez
2025-07-21 9:21 ` Petr Pavlu
2025-07-28 6:43 ` Daniel Gomez
2025-06-30 14:32 ` [PATCH 4/5] tracing: Replace MAX_PARAM_PREFIX_LEN with MODULE_NAME_LEN Petr Pavlu
2025-07-28 6:48 ` Daniel Gomez [this message]
2025-07-28 14:34 ` Steven Rostedt
2025-06-30 14:32 ` [PATCH 5/5] module: Rename MAX_PARAM_PREFIX_LEN to __MODULE_NAME_LEN Petr Pavlu
2025-07-28 6:48 ` Daniel Gomez
2025-07-31 12:03 ` [PATCH 0/5] module: Fix minor problems related to MODULE_NAME_LEN Daniel Gomez
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=e9caf91d-3a4b-4140-a3bc-0c2b53c0a220@kernel.org \
--to=da.gomez@kernel.org \
--cc=da.gomez@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=mhiramat@kernel.org \
--cc=petr.pavlu@suse.com \
--cc=rostedt@goodmis.org \
--cc=samitolvanen@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
all inboxes | Powered by JetHome®