diff options
author | Jessica Yu <jeyu@kernel.org> | 2018-06-29 10:37:08 -0400 |
---|---|---|
committer | Jessica Yu <jeyu@kernel.org> | 2018-07-02 05:36:17 -0400 |
commit | f314dfea16a085a58d2ff227ea9fa9e490ee5d18 (patch) | |
tree | c203005916d88e491f9cf333929ca9830a84277d /kernel/module-internal.h | |
parent | 996302c5e85650722f1e5aeaeaaac12f9f362bf8 (diff) |
modsign: log module name in the event of an error
Now that we have the load_info struct all initialized (including
info->name, which contains the name of the module) before
module_sig_check(), make the load_info struct and hence module name
available to mod_verify_sig() so that we can log the module name in the
event of an error.
Signed-off-by: Jessica Yu <jeyu@kernel.org>
Diffstat (limited to 'kernel/module-internal.h')
-rw-r--r-- | kernel/module-internal.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/kernel/module-internal.h b/kernel/module-internal.h index 915e123a430f..79c9be2dbbe9 100644 --- a/kernel/module-internal.h +++ b/kernel/module-internal.h | |||
@@ -9,4 +9,27 @@ | |||
9 | * 2 of the Licence, or (at your option) any later version. | 9 | * 2 of the Licence, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | extern int mod_verify_sig(const void *mod, unsigned long *_modlen); | 12 | #include <linux/elf.h> |
13 | #include <asm/module.h> | ||
14 | |||
15 | struct load_info { | ||
16 | const char *name; | ||
17 | /* pointer to module in temporary copy, freed at end of load_module() */ | ||
18 | struct module *mod; | ||
19 | Elf_Ehdr *hdr; | ||
20 | unsigned long len; | ||
21 | Elf_Shdr *sechdrs; | ||
22 | char *secstrings, *strtab; | ||
23 | unsigned long symoffs, stroffs; | ||
24 | struct _ddebug *debug; | ||
25 | unsigned int num_debug; | ||
26 | bool sig_ok; | ||
27 | #ifdef CONFIG_KALLSYMS | ||
28 | unsigned long mod_kallsyms_init_off; | ||
29 | #endif | ||
30 | struct { | ||
31 | unsigned int sym, str, mod, vers, info, pcpu; | ||
32 | } index; | ||
33 | }; | ||
34 | |||
35 | extern int mod_verify_sig(const void *mod, struct load_info *info); | ||