Blob Blame History Raw
From 4f9ed1bb71eb48ec2c4c7d5c31b116e3fe161f36 Mon Sep 17 00:00:00 2001
From: Jessica Yu <jeyu@kernel.org>
Date: Wed, 30 May 2018 10:46:28 +0200
Subject: [PATCH 5/5] modsign: print module name along with error message
Patch-mainline: No, submitted https://lkml.kernel.org/r/20180530090830.20737-4-jeyu@kernel.org
References: bsc#1093666

It is useful to know which module failed signature verification, so
print the module name along with the error message.

Signed-off-by: Jessica Yu <jeyu@kernel.org>
Acked-by: Jessica Yu <jeyu@suse.de>
---
 kernel/module.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index 49b9c706bb1c..e2ae46d0abb9 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2860,11 +2860,13 @@ static int module_sig_check(struct load_info *info, int flags)
 		reason = "Loading of module with unavailable key";
 	decide:
 		if (sig_enforce) {
-			pr_notice("%s is rejected\n", reason);
+			pr_notice("%s: %s is rejected\n",
+				  info->mod->name, reason);
 			return -EKEYREJECTED;
 		}
 		if (kernel_is_locked_down()) {
-			pr_notice("%s is rejected, kernel is locked down\n", reason);
+			pr_notice("%s: %s is rejected, kernel is locked down\n",
+				  info->mod->name, reason);
 			return -EPERM;
 		}
 		return 0;
-- 
2.16.4