From: Jinchao Wang <wangjinchao600@gmail.com>
To: Daniel Gomez <da.gomez@kernel.org>,
Luis Chamberlain <mcgrof@kernel.org>,
Petr Pavlu <petr.pavlu@suse.com>,
Sami Tolvanen <samitolvanen@google.com>,
linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/4] module: show why force load fails
Date: Tue, 2 Sep 2025 10:06:40 +0800 [thread overview]
Message-ID: <c853de6a-ab46-4228-953f-f509e0c84b74@gmail.com> (raw)
In-Reply-To: <851c227e-5d1e-44bb-80ca-d9e230e8ccfe@kernel.org>
On 9/2/25 02:29, Daniel Gomez wrote:
> On 29/08/2025 10.49, Jinchao Wang wrote:
>> Include reason in error message when force loading is disabled.
>>
>> Signed-off-by: Jinchao Wang<wangjinchao600@gmail.com>
>> ---
>> kernel/module/main.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/kernel/module/main.c b/kernel/module/main.c
>> index c66b26184936..e7484c6ce6e3 100644
>> --- a/kernel/module/main.c
>> +++ b/kernel/module/main.c
>> @@ -1083,6 +1083,7 @@ int try_to_force_load(struct module *mod, const char *reason)
>> add_taint_module(mod, TAINT_FORCED_MODULE, LOCKDEP_NOW_UNRELIABLE);
>> return 0;
>> #else
>> + pr_err("%s: %s, force load is not supported\n", mod->name, reason);
>> return -ENOEXEC;
>> #endif
>> }
> I don't think is good to inform via kernel log buffer what the kernel supports
> or what not. And definitely, not as an error.
>
Thank you for the feedback.
When debugging syzkaller, I noticed that insmod only reports a generic
failure. To understand the exact reason, I needed to trace the kernel.
This patch was meant to make it more convenient to see the precise
cause directly.
In my view, if the caller cannot perform the requested operation, that
represents an error, and the kernel log buffer is the natural place to
report the reason. This makes debugging and testing easier without
requiring additional tracing.
--
Best regards,
Jinchao
next prev parent reply other threads:[~2025-09-02 2:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 8:49 [PATCH v3 0/4] module: logging and code improvements Jinchao Wang
2025-08-29 8:49 ` [PATCH v3 1/4] module: signing: Use pr_err for signature rejection Jinchao Wang
2025-09-01 9:25 ` Petr Pavlu
2025-09-01 18:18 ` Daniel Gomez
2025-09-02 1:57 ` Jinchao Wang
2025-08-29 8:49 ` [PATCH v3 2/4] module: show why force load fails Jinchao Wang
2025-09-01 9:26 ` Petr Pavlu
2025-09-01 18:29 ` Daniel Gomez
2025-09-02 2:06 ` Jinchao Wang [this message]
2025-08-29 8:49 ` [PATCH v3 3/4] module: centralize no-versions force load check Jinchao Wang
2025-09-01 9:30 ` Petr Pavlu
2025-08-29 8:49 ` [PATCH v3 4/4] module: separate vermagic and livepatch checks Jinchao Wang
2025-09-01 9:34 ` Petr Pavlu
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=c853de6a-ab46-4228-953f-f509e0c84b74@gmail.com \
--to=wangjinchao600@gmail.com \
--cc=da.gomez@kernel.org \
--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 \
/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®