diff options
Diffstat (limited to 'kernel/module.c')
| -rw-r--r-- | kernel/module.c | 18 | 
1 files changed, 6 insertions, 12 deletions
| diff --git a/kernel/module.c b/kernel/module.c index 81e727cf6df9..6f69463f0066 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -60,7 +60,6 @@ | |||
| 60 | #include <linux/jump_label.h> | 60 | #include <linux/jump_label.h> | 
| 61 | #include <linux/pfn.h> | 61 | #include <linux/pfn.h> | 
| 62 | #include <linux/bsearch.h> | 62 | #include <linux/bsearch.h> | 
| 63 | #include <linux/fips.h> | ||
| 64 | #include <uapi/linux/module.h> | 63 | #include <uapi/linux/module.h> | 
| 65 | #include "module-internal.h" | 64 | #include "module-internal.h" | 
| 66 | 65 | ||
| @@ -2448,9 +2447,6 @@ static int module_sig_check(struct load_info *info) | |||
| 2448 | } | 2447 | } | 
| 2449 | 2448 | ||
| 2450 | /* Not having a signature is only an error if we're strict. */ | 2449 | /* Not having a signature is only an error if we're strict. */ | 
| 2451 | if (err < 0 && fips_enabled) | ||
| 2452 | panic("Module verification failed with error %d in FIPS mode\n", | ||
| 2453 | err); | ||
| 2454 | if (err == -ENOKEY && !sig_enforce) | 2450 | if (err == -ENOKEY && !sig_enforce) | 
| 2455 | err = 0; | 2451 | err = 0; | 
| 2456 | 2452 | ||
| @@ -3385,6 +3381,8 @@ static inline int within(unsigned long addr, void *start, unsigned long size) | |||
| 3385 | */ | 3381 | */ | 
| 3386 | static inline int is_arm_mapping_symbol(const char *str) | 3382 | static inline int is_arm_mapping_symbol(const char *str) | 
| 3387 | { | 3383 | { | 
| 3384 | if (str[0] == '.' && str[1] == 'L') | ||
| 3385 | return true; | ||
| 3388 | return str[0] == '$' && strchr("atd", str[1]) | 3386 | return str[0] == '$' && strchr("atd", str[1]) | 
| 3389 | && (str[2] == '\0' || str[2] == '.'); | 3387 | && (str[2] == '\0' || str[2] == '.'); | 
| 3390 | } | 3388 | } | 
| @@ -3448,8 +3446,7 @@ const char *module_address_lookup(unsigned long addr, | |||
| 3448 | list_for_each_entry_rcu(mod, &modules, list) { | 3446 | list_for_each_entry_rcu(mod, &modules, list) { | 
| 3449 | if (mod->state == MODULE_STATE_UNFORMED) | 3447 | if (mod->state == MODULE_STATE_UNFORMED) | 
| 3450 | continue; | 3448 | continue; | 
| 3451 | if (within_module_init(addr, mod) || | 3449 | if (within_module(addr, mod)) { | 
| 3452 | within_module_core(addr, mod)) { | ||
| 3453 | if (modname) | 3450 | if (modname) | 
| 3454 | *modname = mod->name; | 3451 | *modname = mod->name; | 
| 3455 | ret = get_ksymbol(mod, addr, size, offset); | 3452 | ret = get_ksymbol(mod, addr, size, offset); | 
| @@ -3473,8 +3470,7 @@ int lookup_module_symbol_name(unsigned long addr, char *symname) | |||
| 3473 | list_for_each_entry_rcu(mod, &modules, list) { | 3470 | list_for_each_entry_rcu(mod, &modules, list) { | 
| 3474 | if (mod->state == MODULE_STATE_UNFORMED) | 3471 | if (mod->state == MODULE_STATE_UNFORMED) | 
| 3475 | continue; | 3472 | continue; | 
| 3476 | if (within_module_init(addr, mod) || | 3473 | if (within_module(addr, mod)) { | 
| 3477 | within_module_core(addr, mod)) { | ||
| 3478 | const char *sym; | 3474 | const char *sym; | 
| 3479 | 3475 | ||
| 3480 | sym = get_ksymbol(mod, addr, NULL, NULL); | 3476 | sym = get_ksymbol(mod, addr, NULL, NULL); | 
| @@ -3499,8 +3495,7 @@ int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, | |||
| 3499 | list_for_each_entry_rcu(mod, &modules, list) { | 3495 | list_for_each_entry_rcu(mod, &modules, list) { | 
| 3500 | if (mod->state == MODULE_STATE_UNFORMED) | 3496 | if (mod->state == MODULE_STATE_UNFORMED) | 
| 3501 | continue; | 3497 | continue; | 
| 3502 | if (within_module_init(addr, mod) || | 3498 | if (within_module(addr, mod)) { | 
| 3503 | within_module_core(addr, mod)) { | ||
| 3504 | const char *sym; | 3499 | const char *sym; | 
| 3505 | 3500 | ||
| 3506 | sym = get_ksymbol(mod, addr, size, offset); | 3501 | sym = get_ksymbol(mod, addr, size, offset); | 
| @@ -3764,8 +3759,7 @@ struct module *__module_address(unsigned long addr) | |||
| 3764 | list_for_each_entry_rcu(mod, &modules, list) { | 3759 | list_for_each_entry_rcu(mod, &modules, list) { | 
| 3765 | if (mod->state == MODULE_STATE_UNFORMED) | 3760 | if (mod->state == MODULE_STATE_UNFORMED) | 
| 3766 | continue; | 3761 | continue; | 
| 3767 | if (within_module_core(addr, mod) | 3762 | if (within_module(addr, mod)) | 
| 3768 | || within_module_init(addr, mod)) | ||
| 3769 | return mod; | 3763 | return mod; | 
| 3770 | } | 3764 | } | 
| 3771 | return NULL; | 3765 | return NULL; | 
