aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/kernel/module.c b/kernel/module.c
index d24fcf29cb64..079c4615607d 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -640,7 +640,7 @@ static int module_unload_init(struct module *mod)
640 INIT_LIST_HEAD(&mod->target_list); 640 INIT_LIST_HEAD(&mod->target_list);
641 641
642 /* Hold reference count during initialization. */ 642 /* Hold reference count during initialization. */
643 __this_cpu_write(mod->refptr->incs, 1); 643 raw_cpu_write(mod->refptr->incs, 1);
644 644
645 return 0; 645 return 0;
646} 646}
@@ -815,9 +815,6 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
815 return -EFAULT; 815 return -EFAULT;
816 name[MODULE_NAME_LEN-1] = '\0'; 816 name[MODULE_NAME_LEN-1] = '\0';
817 817
818 if (!(flags & O_NONBLOCK))
819 pr_warn("waiting module removal not supported: please upgrade\n");
820
821 if (mutex_lock_interruptible(&module_mutex) != 0) 818 if (mutex_lock_interruptible(&module_mutex) != 0)
822 return -EINTR; 819 return -EINTR;
823 820
@@ -1013,9 +1010,11 @@ static size_t module_flags_taint(struct module *mod, char *buf)
1013 buf[l++] = 'F'; 1010 buf[l++] = 'F';
1014 if (mod->taints & (1 << TAINT_CRAP)) 1011 if (mod->taints & (1 << TAINT_CRAP))
1015 buf[l++] = 'C'; 1012 buf[l++] = 'C';
1013 if (mod->taints & (1 << TAINT_UNSIGNED_MODULE))
1014 buf[l++] = 'E';
1016 /* 1015 /*
1017 * TAINT_FORCED_RMMOD: could be added. 1016 * TAINT_FORCED_RMMOD: could be added.
1018 * TAINT_UNSAFE_SMP, TAINT_MACHINE_CHECK, TAINT_BAD_PAGE don't 1017 * TAINT_CPU_OUT_OF_SPEC, TAINT_MACHINE_CHECK, TAINT_BAD_PAGE don't
1019 * apply to modules. 1018 * apply to modules.
1020 */ 1019 */
1021 return l; 1020 return l;
@@ -1948,6 +1947,10 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
1948 1947
1949 switch (sym[i].st_shndx) { 1948 switch (sym[i].st_shndx) {
1950 case SHN_COMMON: 1949 case SHN_COMMON:
1950 /* Ignore common symbols */
1951 if (!strncmp(name, "__gnu_lto", 9))
1952 break;
1953
1951 /* We compiled with -fno-common. These are not 1954 /* We compiled with -fno-common. These are not
1952 supposed to happen. */ 1955 supposed to happen. */
1953 pr_debug("Common symbol: %s\n", name); 1956 pr_debug("Common symbol: %s\n", name);
@@ -3214,7 +3217,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
3214 pr_notice_once("%s: module verification failed: signature " 3217 pr_notice_once("%s: module verification failed: signature "
3215 "and/or required key missing - tainting " 3218 "and/or required key missing - tainting "
3216 "kernel\n", mod->name); 3219 "kernel\n", mod->name);
3217 add_taint_module(mod, TAINT_FORCED_MODULE, LOCKDEP_STILL_OK); 3220 add_taint_module(mod, TAINT_UNSIGNED_MODULE, LOCKDEP_STILL_OK);
3218 } 3221 }
3219#endif 3222#endif
3220 3223
@@ -3265,6 +3268,9 @@ static int load_module(struct load_info *info, const char __user *uargs,
3265 3268
3266 dynamic_debug_setup(info->debug, info->num_debug); 3269 dynamic_debug_setup(info->debug, info->num_debug);
3267 3270
3271 /* Ftrace init must be called in the MODULE_STATE_UNFORMED state */
3272 ftrace_module_init(mod);
3273
3268 /* Finally it's fully formed, ready to start executing. */ 3274 /* Finally it's fully formed, ready to start executing. */
3269 err = complete_formation(mod, info); 3275 err = complete_formation(mod, info);
3270 if (err) 3276 if (err)
@@ -3809,12 +3815,12 @@ void print_modules(void)
3809 list_for_each_entry_rcu(mod, &modules, list) { 3815 list_for_each_entry_rcu(mod, &modules, list) {
3810 if (mod->state == MODULE_STATE_UNFORMED) 3816 if (mod->state == MODULE_STATE_UNFORMED)
3811 continue; 3817 continue;
3812 printk(" %s%s", mod->name, module_flags(mod, buf)); 3818 pr_cont(" %s%s", mod->name, module_flags(mod, buf));
3813 } 3819 }
3814 preempt_enable(); 3820 preempt_enable();
3815 if (last_unloaded_module[0]) 3821 if (last_unloaded_module[0])
3816 printk(" [last unloaded: %s]", last_unloaded_module); 3822 pr_cont(" [last unloaded: %s]", last_unloaded_module);
3817 printk("\n"); 3823 pr_cont("\n");
3818} 3824}
3819 3825
3820#ifdef CONFIG_MODVERSIONS 3826#ifdef CONFIG_MODVERSIONS