summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/kernel/module.c b/kernel/module.c
index f57dd63186e6..a4acd8f403ae 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -330,7 +330,7 @@ static inline void add_taint_module(struct module *mod, unsigned flag,
330 enum lockdep_ok lockdep_ok) 330 enum lockdep_ok lockdep_ok)
331{ 331{
332 add_taint(flag, lockdep_ok); 332 add_taint(flag, lockdep_ok);
333 mod->taints |= (1U << flag); 333 set_bit(flag, &mod->taints);
334} 334}
335 335
336/* 336/*
@@ -1138,24 +1138,13 @@ static inline int module_unload_init(struct module *mod)
1138static size_t module_flags_taint(struct module *mod, char *buf) 1138static size_t module_flags_taint(struct module *mod, char *buf)
1139{ 1139{
1140 size_t l = 0; 1140 size_t l = 0;
1141 int i;
1142
1143 for (i = 0; i < TAINT_FLAGS_COUNT; i++) {
1144 if (taint_flags[i].module && test_bit(i, &mod->taints))
1145 buf[l++] = taint_flags[i].true;
1146 }
1141 1147
1142 if (mod->taints & (1 << TAINT_PROPRIETARY_MODULE))
1143 buf[l++] = 'P';
1144 if (mod->taints & (1 << TAINT_OOT_MODULE))
1145 buf[l++] = 'O';
1146 if (mod->taints & (1 << TAINT_FORCED_MODULE))
1147 buf[l++] = 'F';
1148 if (mod->taints & (1 << TAINT_CRAP))
1149 buf[l++] = 'C';
1150 if (mod->taints & (1 << TAINT_UNSIGNED_MODULE))
1151 buf[l++] = 'E';
1152 if (mod->taints & (1 << TAINT_LIVEPATCH))
1153 buf[l++] = 'K';
1154 /*
1155 * TAINT_FORCED_RMMOD: could be added.
1156 * TAINT_CPU_OUT_OF_SPEC, TAINT_MACHINE_CHECK, TAINT_BAD_PAGE don't
1157 * apply to modules.
1158 */
1159 return l; 1148 return l;
1160} 1149}
1161 1150
@@ -4041,6 +4030,10 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
4041} 4030}
4042#endif /* CONFIG_KALLSYMS */ 4031#endif /* CONFIG_KALLSYMS */
4043 4032
4033/* Maximum number of characters written by module_flags() */
4034#define MODULE_FLAGS_BUF_SIZE (TAINT_FLAGS_COUNT + 4)
4035
4036/* Keep in sync with MODULE_FLAGS_BUF_SIZE !!! */
4044static char *module_flags(struct module *mod, char *buf) 4037static char *module_flags(struct module *mod, char *buf)
4045{ 4038{
4046 int bx = 0; 4039 int bx = 0;
@@ -4085,7 +4078,7 @@ static void m_stop(struct seq_file *m, void *p)
4085static int m_show(struct seq_file *m, void *p) 4078static int m_show(struct seq_file *m, void *p)
4086{ 4079{
4087 struct module *mod = list_entry(p, struct module, list); 4080 struct module *mod = list_entry(p, struct module, list);
4088 char buf[8]; 4081 char buf[MODULE_FLAGS_BUF_SIZE];
4089 4082
4090 /* We always ignore unformed modules. */ 4083 /* We always ignore unformed modules. */
4091 if (mod->state == MODULE_STATE_UNFORMED) 4084 if (mod->state == MODULE_STATE_UNFORMED)
@@ -4256,7 +4249,7 @@ EXPORT_SYMBOL_GPL(__module_text_address);
4256void print_modules(void) 4249void print_modules(void)
4257{ 4250{
4258 struct module *mod; 4251 struct module *mod;
4259 char buf[8]; 4252 char buf[MODULE_FLAGS_BUF_SIZE];
4260 4253
4261 printk(KERN_DEFAULT "Modules linked in:"); 4254 printk(KERN_DEFAULT "Modules linked in:");
4262 /* Most callers should already have preempt disabled, but make sure */ 4255 /* Most callers should already have preempt disabled, but make sure */