aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-06 20:28:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-06 20:28:32 -0500
commitd4a2e61f0b7a7b5b9e321e776a1e874c02e847e4 (patch)
treed90b71a99cb82809d56f9798f59d175b57562803 /kernel
parent0e4c9dc2f2e0fb6d3838eba34382fc6d2d1c381c (diff)
parent2449b8ba0745327c5fa49a8d9acffe03b2eded69 (diff)
Merge git://github.com/rustyrussell/linux
* git://github.com/rustyrussell/linux: module,bug: Add TAINT_OOT_MODULE flag for modules not built in-tree module: Enable dynamic debugging regardless of taint
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c11
-rw-r--r--kernel/panic.c2
2 files changed, 9 insertions, 4 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 93342d992f34..ef8cb70c6996 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2487,6 +2487,9 @@ static int check_modinfo(struct module *mod, struct load_info *info)
2487 return -ENOEXEC; 2487 return -ENOEXEC;
2488 } 2488 }
2489 2489
2490 if (!get_modinfo(info, "intree"))
2491 add_taint_module(mod, TAINT_OOT_MODULE);
2492
2490 if (get_modinfo(info, "staging")) { 2493 if (get_modinfo(info, "staging")) {
2491 add_taint_module(mod, TAINT_CRAP); 2494 add_taint_module(mod, TAINT_CRAP);
2492 printk(KERN_WARNING "%s: module is from the staging directory," 2495 printk(KERN_WARNING "%s: module is from the staging directory,"
@@ -2878,8 +2881,7 @@ static struct module *load_module(void __user *umod,
2878 } 2881 }
2879 2882
2880 /* This has to be done once we're sure module name is unique. */ 2883 /* This has to be done once we're sure module name is unique. */
2881 if (!mod->taints || mod->taints == (1U<<TAINT_CRAP)) 2884 dynamic_debug_setup(info.debug, info.num_debug);
2882 dynamic_debug_setup(info.debug, info.num_debug);
2883 2885
2884 /* Find duplicate symbols */ 2886 /* Find duplicate symbols */
2885 err = verify_export_symbols(mod); 2887 err = verify_export_symbols(mod);
@@ -2915,8 +2917,7 @@ static struct module *load_module(void __user *umod,
2915 module_bug_cleanup(mod); 2917 module_bug_cleanup(mod);
2916 2918
2917 ddebug: 2919 ddebug:
2918 if (!mod->taints || mod->taints == (1U<<TAINT_CRAP)) 2920 dynamic_debug_remove(info.debug);
2919 dynamic_debug_remove(info.debug);
2920 unlock: 2921 unlock:
2921 mutex_unlock(&module_mutex); 2922 mutex_unlock(&module_mutex);
2922 synchronize_sched(); 2923 synchronize_sched();
@@ -3257,6 +3258,8 @@ static char *module_flags(struct module *mod, char *buf)
3257 buf[bx++] = '('; 3258 buf[bx++] = '(';
3258 if (mod->taints & (1 << TAINT_PROPRIETARY_MODULE)) 3259 if (mod->taints & (1 << TAINT_PROPRIETARY_MODULE))
3259 buf[bx++] = 'P'; 3260 buf[bx++] = 'P';
3261 else if (mod->taints & (1 << TAINT_OOT_MODULE))
3262 buf[bx++] = 'O';
3260 if (mod->taints & (1 << TAINT_FORCED_MODULE)) 3263 if (mod->taints & (1 << TAINT_FORCED_MODULE))
3261 buf[bx++] = 'F'; 3264 buf[bx++] = 'F';
3262 if (mod->taints & (1 << TAINT_CRAP)) 3265 if (mod->taints & (1 << TAINT_CRAP))
diff --git a/kernel/panic.c b/kernel/panic.c
index d7bb6974efb5..b26593604214 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -177,6 +177,7 @@ static const struct tnt tnts[] = {
177 { TAINT_WARN, 'W', ' ' }, 177 { TAINT_WARN, 'W', ' ' },
178 { TAINT_CRAP, 'C', ' ' }, 178 { TAINT_CRAP, 'C', ' ' },
179 { TAINT_FIRMWARE_WORKAROUND, 'I', ' ' }, 179 { TAINT_FIRMWARE_WORKAROUND, 'I', ' ' },
180 { TAINT_OOT_MODULE, 'O', ' ' },
180}; 181};
181 182
182/** 183/**
@@ -194,6 +195,7 @@ static const struct tnt tnts[] = {
194 * 'W' - Taint on warning. 195 * 'W' - Taint on warning.
195 * 'C' - modules from drivers/staging are loaded. 196 * 'C' - modules from drivers/staging are loaded.
196 * 'I' - Working around severe firmware bug. 197 * 'I' - Working around severe firmware bug.
198 * 'O' - Out-of-tree module has been loaded.
197 * 199 *
198 * The string is overwritten by the next call to print_tainted(). 200 * The string is overwritten by the next call to print_tainted().
199 */ 201 */