mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] module: fix invalid ELF structure error to print error code
@ 2021-09-23  0:14 Shuah Khan
  2021-09-23  2:59 ` Luis Chamberlain
  0 siblings, 1 reply; 4+ messages in thread
From: Shuah Khan @ 2021-09-23  0:14 UTC (permalink / raw)
  To: mcgrof, jeyu; +Cc: Shuah Khan, linux-kernel

When elf_validity_check() returns error, load_module() prints an
error message without error code. It is hard to determine why the
module ELF structure is invalid without this information. Fix the
error message to print the error code.

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
---
 kernel/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/module.c b/kernel/module.c
index 40ec9a030eec..a0d412d396d6 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3941,7 +3941,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
 	 */
 	err = elf_validity_check(info);
 	if (err) {
-		pr_err("Module has invalid ELF structures\n");
+		pr_err("Module has invalid ELF structures:errno(%ld)\n", err);
 		goto free_copy;
 	}
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-24  3:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23  0:14 [PATCH] module: fix invalid ELF structure error to print error code Shuah Khan
2021-09-23  2:59 ` Luis Chamberlain
2021-09-23 22:37   ` Shuah Khan
2021-09-24  3:12     ` Luis Chamberlain

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®