* [PATCH v2] module: Add log information for loading module failures
@ 2024-06-19 8:30 Yusong Gao
2024-06-20 23:44 ` Luis Chamberlain
0 siblings, 1 reply; 2+ messages in thread
From: Yusong Gao @ 2024-06-19 8:30 UTC (permalink / raw)
To: mcgrof; +Cc: linux-modules, linux-kernel, a869920004
Add log information in kernel-space when loading module failures.
Try to load the unsigned module and the module with bad signature
when set 1 to /sys/module/module/parameters/sig_enforce.
Unsigned module case:
(linux) insmod unsigned.ko
[ 18.714661] Loading of unsigned module is rejected
insmod: can't insert 'unsigned.ko': Key was rejected by service
(linux)
Bad signature module case:
(linux) insmod bad_signature.ko
insmod: can't insert 'bad_signature.ko': Key was rejected by service
(linux)
There have different logging behavior the bad signature case only log
in user-space, add log info for fatal errors in module_sig_check().
Signed-off-by: Yusong Gao <a869920004@gmail.com>
---
V2: Change print level from notice to debug.
---
kernel/module/signing.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/module/signing.c b/kernel/module/signing.c
index a2ff4242e623..b0c7b30e4d89 100644
--- a/kernel/module/signing.c
+++ b/kernel/module/signing.c
@@ -113,6 +113,7 @@ int module_sig_check(struct load_info *info, int flags)
* unparseable signatures, and signature check failures --
* even if signatures aren't required.
*/
+ pr_debug("Loading module failed (errno=%d)\n", -err);
return err;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] module: Add log information for loading module failures
2024-06-19 8:30 [PATCH v2] module: Add log information for loading module failures Yusong Gao
@ 2024-06-20 23:44 ` Luis Chamberlain
0 siblings, 0 replies; 2+ messages in thread
From: Luis Chamberlain @ 2024-06-20 23:44 UTC (permalink / raw)
To: Yusong Gao; +Cc: linux-modules, linux-kernel
On Wed, Jun 19, 2024 at 08:30:37AM +0000, Yusong Gao wrote:
> Add log information in kernel-space when loading module failures.
> Try to load the unsigned module and the module with bad signature
> when set 1 to /sys/module/module/parameters/sig_enforce.
>
> Unsigned module case:
> (linux) insmod unsigned.ko
> [ 18.714661] Loading of unsigned module is rejected
> insmod: can't insert 'unsigned.ko': Key was rejected by service
> (linux)
>
> Bad signature module case:
> (linux) insmod bad_signature.ko
> insmod: can't insert 'bad_signature.ko': Key was rejected by service
> (linux)
>
> There have different logging behavior the bad signature case only log
> in user-space, add log info for fatal errors in module_sig_check().
>
> Signed-off-by: Yusong Gao <a869920004@gmail.com>
> ---
> V2: Change print level from notice to debug.
> ---
> kernel/module/signing.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/module/signing.c b/kernel/module/signing.c
> index a2ff4242e623..b0c7b30e4d89 100644
> --- a/kernel/module/signing.c
> +++ b/kernel/module/signing.c
> @@ -113,6 +113,7 @@ int module_sig_check(struct load_info *info, int flags)
> * unparseable signatures, and signature check failures --
> * even if signatures aren't required.
> */
> + pr_debug("Loading module failed (errno=%d)\n", -err);
There are so many debug message, this doesn't help explain why, ie, tha
this is a signature issue.
Luis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-20 23:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-19 8:30 [PATCH v2] module: Add log information for loading module failures Yusong Gao
2024-06-20 23:44 ` Luis Chamberlain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).