diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2011-10-24 09:12:28 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-11-06 16:24:42 -0500 |
commit | 2449b8ba0745327c5fa49a8d9acffe03b2eded69 (patch) | |
tree | 48e11288635dcfc8cdb342f3ba00fa2a2a650aa8 /kernel | |
parent | 1cd0d6c3021c8d76641b37203f504634b87fbabc (diff) |
module,bug: Add TAINT_OOT_MODULE flag for modules not built in-tree
Use of the GPL or a compatible licence doesn't necessarily make the code
any good. We already consider staging modules to be suspect, and this
should also be true for out-of-tree modules which may receive very
little review.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Reviewed-by: Dave Jones <davej@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (patched oops-tracing.txt)
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 5 | ||||
-rw-r--r-- | kernel/panic.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index 3c5509642847..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," |
@@ -3255,6 +3258,8 @@ static char *module_flags(struct module *mod, char *buf) | |||
3255 | buf[bx++] = '('; | 3258 | buf[bx++] = '('; |
3256 | if (mod->taints & (1 << TAINT_PROPRIETARY_MODULE)) | 3259 | if (mod->taints & (1 << TAINT_PROPRIETARY_MODULE)) |
3257 | buf[bx++] = 'P'; | 3260 | buf[bx++] = 'P'; |
3261 | else if (mod->taints & (1 << TAINT_OOT_MODULE)) | ||
3262 | buf[bx++] = 'O'; | ||
3258 | if (mod->taints & (1 << TAINT_FORCED_MODULE)) | 3263 | if (mod->taints & (1 << TAINT_FORCED_MODULE)) |
3259 | buf[bx++] = 'F'; | 3264 | buf[bx++] = 'F'; |
3260 | 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 | */ |