aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/oops-tracing.txt2
-rw-r--r--include/linux/kernel.h1
-rw-r--r--kernel/module.c5
-rw-r--r--kernel/panic.c2
-rw-r--r--scripts/mod/modpost.c7
5 files changed, 17 insertions, 0 deletions
diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt
index 6fe9001b926..13032c0140d 100644
--- a/Documentation/oops-tracing.txt
+++ b/Documentation/oops-tracing.txt
@@ -263,6 +263,8 @@ characters, each representing a particular tainted value.
263 12: 'I' if the kernel is working around a severe bug in the platform 263 12: 'I' if the kernel is working around a severe bug in the platform
264 firmware (BIOS or similar). 264 firmware (BIOS or similar).
265 265
266 13: 'O' if an externally-built ("out-of-tree") module has been loaded.
267
266The primary reason for the 'Tainted: ' string is to tell kernel 268The primary reason for the 'Tainted: ' string is to tell kernel
267debuggers if this is a clean kernel or if anything unusual has 269debuggers if this is a clean kernel or if anything unusual has
268occurred. Tainting is permanent: even if an offending module is 270occurred. Tainting is permanent: even if an offending module is
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 4c0d3b2fd5f..e8b1597b5cf 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -371,6 +371,7 @@ extern enum system_states {
371#define TAINT_WARN 9 371#define TAINT_WARN 9
372#define TAINT_CRAP 10 372#define TAINT_CRAP 10
373#define TAINT_FIRMWARE_WORKAROUND 11 373#define TAINT_FIRMWARE_WORKAROUND 11
374#define TAINT_OOT_MODULE 12
374 375
375extern const char hex_asc[]; 376extern const char hex_asc[];
376#define hex_asc_lo(x) hex_asc[((x) & 0x0f)] 377#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
diff --git a/kernel/module.c b/kernel/module.c
index 3c550964284..ef8cb70c699 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 d7bb6974efb..b2659360421 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 */
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index a509ff8f32f..2bd594e6d1b 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1849,6 +1849,12 @@ static void add_header(struct buffer *b, struct module *mod)
1849 buf_printf(b, "};\n"); 1849 buf_printf(b, "};\n");
1850} 1850}
1851 1851
1852static void add_intree_flag(struct buffer *b, int is_intree)
1853{
1854 if (is_intree)
1855 buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n");
1856}
1857
1852static void add_staging_flag(struct buffer *b, const char *name) 1858static void add_staging_flag(struct buffer *b, const char *name)
1853{ 1859{
1854 static const char *staging_dir = "drivers/staging"; 1860 static const char *staging_dir = "drivers/staging";
@@ -2169,6 +2175,7 @@ int main(int argc, char **argv)
2169 buf.pos = 0; 2175 buf.pos = 0;
2170 2176
2171 add_header(&buf, mod); 2177 add_header(&buf, mod);
2178 add_intree_flag(&buf, !external_module);
2172 add_staging_flag(&buf, mod->name); 2179 add_staging_flag(&buf, mod->name);
2173 err |= add_versions(&buf, mod); 2180 err |= add_versions(&buf, mod);
2174 add_depends(&buf, mod, modules); 2181 add_depends(&buf, mod, modules);