aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/kernel/traps.c2
-rw-r--r--arch/arm/kernel/traps.c2
-rw-r--r--arch/arm64/kernel/traps.c2
-rw-r--r--arch/avr32/kernel/traps.c2
-rw-r--r--arch/hexagon/kernel/traps.c2
-rw-r--r--arch/ia64/kernel/traps.c2
-rw-r--r--arch/m68k/kernel/traps.c2
-rw-r--r--arch/mips/kernel/traps.c2
-rw-r--r--arch/parisc/kernel/traps.c2
-rw-r--r--arch/powerpc/kernel/traps.c2
-rw-r--r--arch/s390/kernel/traps.c2
-rw-r--r--arch/sh/kernel/traps.c2
-rw-r--r--arch/sparc/kernel/setup_64.c2
-rw-r--r--arch/sparc/kernel/traps_32.c2
-rw-r--r--arch/sparc/kernel/traps_64.c2
-rw-r--r--arch/unicore32/kernel/traps.c2
-rw-r--r--arch/x86/kernel/cpu/amd.c3
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/p5.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/winchip.c2
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c2
-rw-r--r--arch/x86/kernel/dumpstack.c2
-rw-r--r--arch/xtensa/kernel/traps.c2
-rw-r--r--drivers/acpi/custom_method.c2
-rw-r--r--drivers/acpi/osl.c2
-rw-r--r--drivers/base/regmap/regmap-debugfs.c2
-rw-r--r--include/linux/kernel.h6
-rw-r--r--kernel/module.c26
-rw-r--r--kernel/panic.c34
-rw-r--r--kernel/sched/core.c2
-rw-r--r--kernel/sysctl.c2
-rw-r--r--lib/bug.c3
-rw-r--r--mm/memory.c2
-rw-r--r--mm/page_alloc.c2
-rw-r--r--mm/slab.c2
-rw-r--r--mm/slub.c2
-rw-r--r--sound/soc/soc-core.c2
37 files changed, 69 insertions, 67 deletions
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
index 272666d006df..4037461a6493 100644
--- a/arch/alpha/kernel/traps.c
+++ b/arch/alpha/kernel/traps.c
@@ -186,7 +186,7 @@ die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15)
186#endif 186#endif
187 printk("%s(%d): %s %ld\n", current->comm, task_pid_nr(current), str, err); 187 printk("%s(%d): %s %ld\n", current->comm, task_pid_nr(current), str, err);
188 dik_show_regs(regs, r9_15); 188 dik_show_regs(regs, r9_15);
189 add_taint(TAINT_DIE); 189 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
190 dik_show_trace((unsigned long *)(regs+1)); 190 dik_show_trace((unsigned long *)(regs+1));
191 dik_show_code((unsigned int *)regs->pc); 191 dik_show_code((unsigned int *)regs->pc);
192 192
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index b0179b89a04c..1c089119b2d7 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -296,7 +296,7 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
296 296
297 bust_spinlocks(0); 297 bust_spinlocks(0);
298 die_owner = -1; 298 die_owner = -1;
299 add_taint(TAINT_DIE); 299 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
300 die_nest_count--; 300 die_nest_count--;
301 if (!die_nest_count) 301 if (!die_nest_count)
302 /* Nest count reaches zero, release the lock. */ 302 /* Nest count reaches zero, release the lock. */
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 3883f842434f..b3c5f628bdb4 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -242,7 +242,7 @@ void die(const char *str, struct pt_regs *regs, int err)
242 crash_kexec(regs); 242 crash_kexec(regs);
243 243
244 bust_spinlocks(0); 244 bust_spinlocks(0);
245 add_taint(TAINT_DIE); 245 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
246 raw_spin_unlock_irq(&die_lock); 246 raw_spin_unlock_irq(&die_lock);
247 oops_exit(); 247 oops_exit();
248 248
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c
index 3d760c06f024..682b2478691a 100644
--- a/arch/avr32/kernel/traps.c
+++ b/arch/avr32/kernel/traps.c
@@ -61,7 +61,7 @@ void die(const char *str, struct pt_regs *regs, long err)
61 show_regs_log_lvl(regs, KERN_EMERG); 61 show_regs_log_lvl(regs, KERN_EMERG);
62 show_stack_log_lvl(current, regs->sp, regs, KERN_EMERG); 62 show_stack_log_lvl(current, regs->sp, regs, KERN_EMERG);
63 bust_spinlocks(0); 63 bust_spinlocks(0);
64 add_taint(TAINT_DIE); 64 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
65 spin_unlock_irq(&die_lock); 65 spin_unlock_irq(&die_lock);
66 66
67 if (in_interrupt()) 67 if (in_interrupt())
diff --git a/arch/hexagon/kernel/traps.c b/arch/hexagon/kernel/traps.c
index a41eeb8eeaa1..be5e2dd9c9d3 100644
--- a/arch/hexagon/kernel/traps.c
+++ b/arch/hexagon/kernel/traps.c
@@ -225,7 +225,7 @@ int die(const char *str, struct pt_regs *regs, long err)
225 do_show_stack(current, &regs->r30, pt_elr(regs)); 225 do_show_stack(current, &regs->r30, pt_elr(regs));
226 226
227 bust_spinlocks(0); 227 bust_spinlocks(0);
228 add_taint(TAINT_DIE); 228 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
229 229
230 spin_unlock_irq(&die.lock); 230 spin_unlock_irq(&die.lock);
231 231
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index bd42b76000d1..f7f9f9c6caf0 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -72,7 +72,7 @@ die (const char *str, struct pt_regs *regs, long err)
72 72
73 bust_spinlocks(0); 73 bust_spinlocks(0);
74 die.lock_owner = -1; 74 die.lock_owner = -1;
75 add_taint(TAINT_DIE); 75 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
76 spin_unlock_irq(&die.lock); 76 spin_unlock_irq(&die.lock);
77 77
78 if (!regs) 78 if (!regs)
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index cbc624af4494..f32ab22e7ed3 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -1176,7 +1176,7 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr)
1176 console_verbose(); 1176 console_verbose();
1177 printk("%s: %08x\n",str,nr); 1177 printk("%s: %08x\n",str,nr);
1178 show_registers(fp); 1178 show_registers(fp);
1179 add_taint(TAINT_DIE); 1179 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
1180 do_exit(SIGSEGV); 1180 do_exit(SIGSEGV);
1181} 1181}
1182 1182
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index cf7ac5483f53..9007966d56d4 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -396,7 +396,7 @@ void __noreturn die(const char *str, struct pt_regs *regs)
396 396
397 printk("%s[#%d]:\n", str, ++die_counter); 397 printk("%s[#%d]:\n", str, ++die_counter);
398 show_registers(regs); 398 show_registers(regs);
399 add_taint(TAINT_DIE); 399 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
400 raw_spin_unlock_irq(&die_lock); 400 raw_spin_unlock_irq(&die_lock);
401 401
402 oops_exit(); 402 oops_exit();
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 45ba99f5080b..aeb8f8f2c07a 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -282,7 +282,7 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err)
282 282
283 show_regs(regs); 283 show_regs(regs);
284 dump_stack(); 284 dump_stack();
285 add_taint(TAINT_DIE); 285 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
286 286
287 if (in_interrupt()) 287 if (in_interrupt())
288 panic("Fatal exception in interrupt"); 288 panic("Fatal exception in interrupt");
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 32518401af68..c579db859388 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -138,7 +138,7 @@ static void __kprobes oops_end(unsigned long flags, struct pt_regs *regs,
138{ 138{
139 bust_spinlocks(0); 139 bust_spinlocks(0);
140 die_owner = -1; 140 die_owner = -1;
141 add_taint(TAINT_DIE); 141 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
142 die_nest_count--; 142 die_nest_count--;
143 oops_exit(); 143 oops_exit();
144 printk("\n"); 144 printk("\n");
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 70ecfc5fe8f0..13dd63fba367 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -271,7 +271,7 @@ void die(struct pt_regs *regs, const char *str)
271 print_modules(); 271 print_modules();
272 show_regs(regs); 272 show_regs(regs);
273 bust_spinlocks(0); 273 bust_spinlocks(0);
274 add_taint(TAINT_DIE); 274 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
275 spin_unlock_irq(&die_lock); 275 spin_unlock_irq(&die_lock);
276 if (in_interrupt()) 276 if (in_interrupt())
277 panic("Fatal exception in interrupt"); 277 panic("Fatal exception in interrupt");
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index 72246bc06884..dfdad72c61ca 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -38,7 +38,7 @@ void die(const char *str, struct pt_regs *regs, long err)
38 notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV); 38 notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV);
39 39
40 bust_spinlocks(0); 40 bust_spinlocks(0);
41 add_taint(TAINT_DIE); 41 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
42 spin_unlock_irq(&die_lock); 42 spin_unlock_irq(&die_lock);
43 oops_exit(); 43 oops_exit();
44 44
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index 0eaf0059aaef..88a127b9c69e 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -115,7 +115,7 @@ static void __init process_switch(char c)
115 break; 115 break;
116 } 116 }
117 cheetah_pcache_forced_on = 1; 117 cheetah_pcache_forced_on = 1;
118 add_taint(TAINT_MACHINE_CHECK); 118 add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
119 cheetah_enable_pcache(); 119 cheetah_enable_pcache();
120 break; 120 break;
121 121
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index a5785ea2a85d..662982946a89 100644
--- a/arch/sparc/kernel/traps_32.c
+++ b/arch/sparc/kernel/traps_32.c
@@ -58,7 +58,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
58 58
59 printk("%s(%d): %s [#%d]\n", current->comm, task_pid_nr(current), str, ++die_counter); 59 printk("%s(%d): %s [#%d]\n", current->comm, task_pid_nr(current), str, ++die_counter);
60 show_regs(regs); 60 show_regs(regs);
61 add_taint(TAINT_DIE); 61 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
62 62
63 __SAVE; __SAVE; __SAVE; __SAVE; 63 __SAVE; __SAVE; __SAVE; __SAVE;
64 __SAVE; __SAVE; __SAVE; __SAVE; 64 __SAVE; __SAVE; __SAVE; __SAVE;
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index e7ecf1507d90..8d38ca97aa23 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -2383,7 +2383,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
2383 notify_die(DIE_OOPS, str, regs, 0, 255, SIGSEGV); 2383 notify_die(DIE_OOPS, str, regs, 0, 255, SIGSEGV);
2384 __asm__ __volatile__("flushw"); 2384 __asm__ __volatile__("flushw");
2385 show_regs(regs); 2385 show_regs(regs);
2386 add_taint(TAINT_DIE); 2386 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
2387 if (regs->tstate & TSTATE_PRIV) { 2387 if (regs->tstate & TSTATE_PRIV) {
2388 struct thread_info *tp = current_thread_info(); 2388 struct thread_info *tp = current_thread_info();
2389 struct reg_window *rw = (struct reg_window *) 2389 struct reg_window *rw = (struct reg_window *)
diff --git a/arch/unicore32/kernel/traps.c b/arch/unicore32/kernel/traps.c
index 2054f0d4db13..0870b68d2ad9 100644
--- a/arch/unicore32/kernel/traps.c
+++ b/arch/unicore32/kernel/traps.c
@@ -231,7 +231,7 @@ void die(const char *str, struct pt_regs *regs, int err)
231 ret = __die(str, err, thread, regs); 231 ret = __die(str, err, thread, regs);
232 232
233 bust_spinlocks(0); 233 bust_spinlocks(0);
234 add_taint(TAINT_DIE); 234 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
235 spin_unlock_irq(&die_lock); 235 spin_unlock_irq(&die_lock);
236 oops_exit(); 236 oops_exit();
237 237
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 15239fffd6fe..5853e57523e5 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -220,8 +220,7 @@ static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c)
220 */ 220 */
221 WARN_ONCE(1, "WARNING: This combination of AMD" 221 WARN_ONCE(1, "WARNING: This combination of AMD"
222 " processors is not suitable for SMP.\n"); 222 " processors is not suitable for SMP.\n");
223 if (!test_taint(TAINT_UNSAFE_SMP)) 223 add_taint(TAINT_UNSAFE_SMP, LOCKDEP_NOW_UNRELIABLE);
224 add_taint(TAINT_UNSAFE_SMP);
225 224
226valid_k7: 225valid_k7:
227 ; 226 ;
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 80dbda84f1c3..6bc15edbc8cd 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1085,7 +1085,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
1085 /* 1085 /*
1086 * Set taint even when machine check was not enabled. 1086 * Set taint even when machine check was not enabled.
1087 */ 1087 */
1088 add_taint(TAINT_MACHINE_CHECK); 1088 add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
1089 1089
1090 severity = mce_severity(&m, cfg->tolerant, NULL); 1090 severity = mce_severity(&m, cfg->tolerant, NULL);
1091 1091
diff --git a/arch/x86/kernel/cpu/mcheck/p5.c b/arch/x86/kernel/cpu/mcheck/p5.c
index 2d5454cd2c4f..1c044b1ccc59 100644
--- a/arch/x86/kernel/cpu/mcheck/p5.c
+++ b/arch/x86/kernel/cpu/mcheck/p5.c
@@ -33,7 +33,7 @@ static void pentium_machine_check(struct pt_regs *regs, long error_code)
33 smp_processor_id()); 33 smp_processor_id());
34 } 34 }
35 35
36 add_taint(TAINT_MACHINE_CHECK); 36 add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
37} 37}
38 38
39/* Set up machine check reporting for processors with Intel style MCE: */ 39/* Set up machine check reporting for processors with Intel style MCE: */
diff --git a/arch/x86/kernel/cpu/mcheck/winchip.c b/arch/x86/kernel/cpu/mcheck/winchip.c
index 2d7998fb628c..e9a701aecaa1 100644
--- a/arch/x86/kernel/cpu/mcheck/winchip.c
+++ b/arch/x86/kernel/cpu/mcheck/winchip.c
@@ -15,7 +15,7 @@
15static void winchip_machine_check(struct pt_regs *regs, long error_code) 15static void winchip_machine_check(struct pt_regs *regs, long error_code)
16{ 16{
17 printk(KERN_EMERG "CPU0: Machine Check Exception.\n"); 17 printk(KERN_EMERG "CPU0: Machine Check Exception.\n");
18 add_taint(TAINT_MACHINE_CHECK); 18 add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
19} 19}
20 20
21/* Set up machine check reporting on the Winchip C6 series */ 21/* Set up machine check reporting on the Winchip C6 series */
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index e9fe907cd249..fa72a39e5d46 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -542,7 +542,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
542 542
543 if (tmp != mask_lo) { 543 if (tmp != mask_lo) {
544 printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n"); 544 printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n");
545 add_taint(TAINT_FIRMWARE_WORKAROUND); 545 add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
546 mask_lo = tmp; 546 mask_lo = tmp;
547 } 547 }
548 } 548 }
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index ae42418bc50f..c8797d55b245 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -232,7 +232,7 @@ void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
232 232
233 bust_spinlocks(0); 233 bust_spinlocks(0);
234 die_owner = -1; 234 die_owner = -1;
235 add_taint(TAINT_DIE); 235 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
236 die_nest_count--; 236 die_nest_count--;
237 if (!die_nest_count) 237 if (!die_nest_count)
238 /* Nest count reaches zero, release the lock. */ 238 /* Nest count reaches zero, release the lock. */
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index 01e0111bf787..ded955d45155 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -524,7 +524,7 @@ void die(const char * str, struct pt_regs * regs, long err)
524 if (!user_mode(regs)) 524 if (!user_mode(regs))
525 show_stack(NULL, (unsigned long*)regs->areg[1]); 525 show_stack(NULL, (unsigned long*)regs->areg[1]);
526 526
527 add_taint(TAINT_DIE); 527 add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
528 spin_unlock_irq(&die_lock); 528 spin_unlock_irq(&die_lock);
529 529
530 if (in_interrupt()) 530 if (in_interrupt())
diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c
index 5d42c2414ae5..cd9a68e2fea9 100644
--- a/drivers/acpi/custom_method.c
+++ b/drivers/acpi/custom_method.c
@@ -66,7 +66,7 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
66 buf = NULL; 66 buf = NULL;
67 if (ACPI_FAILURE(status)) 67 if (ACPI_FAILURE(status))
68 return -EINVAL; 68 return -EINVAL;
69 add_taint(TAINT_OVERRIDDEN_ACPI_TABLE); 69 add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, LOCKDEP_NOW_UNRELIABLE);
70 } 70 }
71 71
72 return count; 72 return count;
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 3ff267861541..535e888bad78 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -661,7 +661,7 @@ static void acpi_table_taint(struct acpi_table_header *table)
661 pr_warn(PREFIX 661 pr_warn(PREFIX
662 "Override [%4.4s-%8.8s], this is unsafe: tainting kernel\n", 662 "Override [%4.4s-%8.8s], this is unsafe: tainting kernel\n",
663 table->signature, table->oem_table_id); 663 table->signature, table->oem_table_id);
664 add_taint(TAINT_OVERRIDDEN_ACPI_TABLE); 664 add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, LOCKDEP_NOW_UNRELIABLE);
665} 665}
666 666
667 667
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 46a213a596e2..f63c830083ec 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -267,7 +267,7 @@ static ssize_t regmap_map_write_file(struct file *file,
267 return -EINVAL; 267 return -EINVAL;
268 268
269 /* Userspace has been fiddling around behind the kernel's back */ 269 /* Userspace has been fiddling around behind the kernel's back */
270 add_taint(TAINT_USER); 270 add_taint(TAINT_USER, LOCKDEP_NOW_UNRELIABLE);
271 271
272 regmap_write(map, reg, value); 272 regmap_write(map, reg, value);
273 return buf_size; 273 return buf_size;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index c566927efcbd..80d36874689b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -398,7 +398,11 @@ extern int panic_on_unrecovered_nmi;
398extern int panic_on_io_nmi; 398extern int panic_on_io_nmi;
399extern int sysctl_panic_on_stackoverflow; 399extern int sysctl_panic_on_stackoverflow;
400extern const char *print_tainted(void); 400extern const char *print_tainted(void);
401extern void add_taint(unsigned flag); 401enum lockdep_ok {
402 LOCKDEP_STILL_OK,
403 LOCKDEP_NOW_UNRELIABLE
404};
405extern void add_taint(unsigned flag, enum lockdep_ok);
402extern int test_taint(unsigned flag); 406extern int test_taint(unsigned flag);
403extern unsigned long get_taint(void); 407extern unsigned long get_taint(void);
404extern int root_mountflags; 408extern int root_mountflags;
diff --git a/kernel/module.c b/kernel/module.c
index e69a5a68766f..cc000dd6e4a8 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -197,9 +197,10 @@ static inline int strong_try_module_get(struct module *mod)
197 return -ENOENT; 197 return -ENOENT;
198} 198}
199 199
200static inline void add_taint_module(struct module *mod, unsigned flag) 200static inline void add_taint_module(struct module *mod, unsigned flag,
201 enum lockdep_ok lockdep_ok)
201{ 202{
202 add_taint(flag); 203 add_taint(flag, lockdep_ok);
203 mod->taints |= (1U << flag); 204 mod->taints |= (1U << flag);
204} 205}
205 206
@@ -727,7 +728,7 @@ static inline int try_force_unload(unsigned int flags)
727{ 728{
728 int ret = (flags & O_TRUNC); 729 int ret = (flags & O_TRUNC);
729 if (ret) 730 if (ret)
730 add_taint(TAINT_FORCED_RMMOD); 731 add_taint(TAINT_FORCED_RMMOD, LOCKDEP_NOW_UNRELIABLE);
731 return ret; 732 return ret;
732} 733}
733#else 734#else
@@ -1138,7 +1139,7 @@ static int try_to_force_load(struct module *mod, const char *reason)
1138 if (!test_taint(TAINT_FORCED_MODULE)) 1139 if (!test_taint(TAINT_FORCED_MODULE))
1139 printk(KERN_WARNING "%s: %s: kernel tainted.\n", 1140 printk(KERN_WARNING "%s: %s: kernel tainted.\n",
1140 mod->name, reason); 1141 mod->name, reason);
1141 add_taint_module(mod, TAINT_FORCED_MODULE); 1142 add_taint_module(mod, TAINT_FORCED_MODULE, LOCKDEP_NOW_UNRELIABLE);
1142 return 0; 1143 return 0;
1143#else 1144#else
1144 return -ENOEXEC; 1145 return -ENOEXEC;
@@ -2147,7 +2148,8 @@ static void set_license(struct module *mod, const char *license)
2147 if (!test_taint(TAINT_PROPRIETARY_MODULE)) 2148 if (!test_taint(TAINT_PROPRIETARY_MODULE))
2148 printk(KERN_WARNING "%s: module license '%s' taints " 2149 printk(KERN_WARNING "%s: module license '%s' taints "
2149 "kernel.\n", mod->name, license); 2150 "kernel.\n", mod->name, license);
2150 add_taint_module(mod, TAINT_PROPRIETARY_MODULE); 2151 add_taint_module(mod, TAINT_PROPRIETARY_MODULE,
2152 LOCKDEP_NOW_UNRELIABLE);
2151 } 2153 }
2152} 2154}
2153 2155
@@ -2700,10 +2702,10 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
2700 } 2702 }
2701 2703
2702 if (!get_modinfo(info, "intree")) 2704 if (!get_modinfo(info, "intree"))
2703 add_taint_module(mod, TAINT_OOT_MODULE); 2705 add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
2704 2706
2705 if (get_modinfo(info, "staging")) { 2707 if (get_modinfo(info, "staging")) {
2706 add_taint_module(mod, TAINT_CRAP); 2708 add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK);
2707 printk(KERN_WARNING "%s: module is from the staging directory," 2709 printk(KERN_WARNING "%s: module is from the staging directory,"
2708 " the quality is unknown, you have been warned.\n", 2710 " the quality is unknown, you have been warned.\n",
2709 mod->name); 2711 mod->name);
@@ -2869,15 +2871,17 @@ static int check_module_license_and_versions(struct module *mod)
2869 * using GPL-only symbols it needs. 2871 * using GPL-only symbols it needs.
2870 */ 2872 */
2871 if (strcmp(mod->name, "ndiswrapper") == 0) 2873 if (strcmp(mod->name, "ndiswrapper") == 0)
2872 add_taint(TAINT_PROPRIETARY_MODULE); 2874 add_taint(TAINT_PROPRIETARY_MODULE, LOCKDEP_NOW_UNRELIABLE);
2873 2875
2874 /* driverloader was caught wrongly pretending to be under GPL */ 2876 /* driverloader was caught wrongly pretending to be under GPL */
2875 if (strcmp(mod->name, "driverloader") == 0) 2877 if (strcmp(mod->name, "driverloader") == 0)
2876 add_taint_module(mod, TAINT_PROPRIETARY_MODULE); 2878 add_taint_module(mod, TAINT_PROPRIETARY_MODULE,
2879 LOCKDEP_NOW_UNRELIABLE);
2877 2880
2878 /* lve claims to be GPL but upstream won't provide source */ 2881 /* lve claims to be GPL but upstream won't provide source */
2879 if (strcmp(mod->name, "lve") == 0) 2882 if (strcmp(mod->name, "lve") == 0)
2880 add_taint_module(mod, TAINT_PROPRIETARY_MODULE); 2883 add_taint_module(mod, TAINT_PROPRIETARY_MODULE,
2884 LOCKDEP_NOW_UNRELIABLE);
2881 2885
2882#ifdef CONFIG_MODVERSIONS 2886#ifdef CONFIG_MODVERSIONS
2883 if ((mod->num_syms && !mod->crcs) 2887 if ((mod->num_syms && !mod->crcs)
@@ -3197,7 +3201,7 @@ again:
3197 "%s: module verification failed: signature and/or" 3201 "%s: module verification failed: signature and/or"
3198 " required key missing - tainting kernel\n", 3202 " required key missing - tainting kernel\n",
3199 mod->name); 3203 mod->name);
3200 add_taint_module(mod, TAINT_FORCED_MODULE); 3204 add_taint_module(mod, TAINT_FORCED_MODULE, LOCKDEP_STILL_OK);
3201 } 3205 }
3202#endif 3206#endif
3203 3207
diff --git a/kernel/panic.c b/kernel/panic.c
index e1b2822fff97..7c57cc9eee2c 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -259,26 +259,19 @@ unsigned long get_taint(void)
259 return tainted_mask; 259 return tainted_mask;
260} 260}
261 261
262void add_taint(unsigned flag) 262/**
263 * add_taint: add a taint flag if not already set.
264 * @flag: one of the TAINT_* constants.
265 * @lockdep_ok: whether lock debugging is still OK.
266 *
267 * If something bad has gone wrong, you'll want @lockdebug_ok = false, but for
268 * some notewortht-but-not-corrupting cases, it can be set to true.
269 */
270void add_taint(unsigned flag, enum lockdep_ok lockdep_ok)
263{ 271{
264 /* 272 if (lockdep_ok == LOCKDEP_NOW_UNRELIABLE && __debug_locks_off())
265 * Can't trust the integrity of the kernel anymore. 273 printk(KERN_WARNING
266 * We don't call directly debug_locks_off() because the issue 274 "Disabling lock debugging due to kernel taint\n");
267 * is not necessarily serious enough to set oops_in_progress to 1
268 * Also we want to keep up lockdep for staging/out-of-tree
269 * development and post-warning case.
270 */
271 switch (flag) {
272 case TAINT_CRAP:
273 case TAINT_OOT_MODULE:
274 case TAINT_WARN:
275 case TAINT_FIRMWARE_WORKAROUND:
276 break;
277
278 default:
279 if (__debug_locks_off())
280 printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n");
281 }
282 275
283 set_bit(flag, &tainted_mask); 276 set_bit(flag, &tainted_mask);
284} 277}
@@ -421,7 +414,8 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
421 print_modules(); 414 print_modules();
422 dump_stack(); 415 dump_stack();
423 print_oops_end_marker(); 416 print_oops_end_marker();
424 add_taint(taint); 417 /* Just a warning, don't kill lockdep. */
418 add_taint(taint, LOCKDEP_STILL_OK);
425} 419}
426 420
427void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...) 421void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 257002c13bb0..662f3d512183 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2785,7 +2785,7 @@ static noinline void __schedule_bug(struct task_struct *prev)
2785 if (irqs_disabled()) 2785 if (irqs_disabled())
2786 print_irqtrace_events(prev); 2786 print_irqtrace_events(prev);
2787 dump_stack(); 2787 dump_stack();
2788 add_taint(TAINT_WARN); 2788 add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
2789} 2789}
2790 2790
2791/* 2791/*
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index c88878db491e..f97f9d75cde8 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2006,7 +2006,7 @@ static int proc_taint(struct ctl_table *table, int write,
2006 int i; 2006 int i;
2007 for (i = 0; i < BITS_PER_LONG && tmptaint >> i; i++) { 2007 for (i = 0; i < BITS_PER_LONG && tmptaint >> i; i++) {
2008 if ((tmptaint >> i) & 1) 2008 if ((tmptaint >> i) & 1)
2009 add_taint(i); 2009 add_taint(i, LOCKDEP_STILL_OK);
2010 } 2010 }
2011 } 2011 }
2012 2012
diff --git a/lib/bug.c b/lib/bug.c
index d0cdf14c651a..168603477f02 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -166,7 +166,8 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
166 print_modules(); 166 print_modules();
167 show_regs(regs); 167 show_regs(regs);
168 print_oops_end_marker(); 168 print_oops_end_marker();
169 add_taint(BUG_GET_TAINT(bug)); 169 /* Just a warning, don't kill lockdep. */
170 add_taint(BUG_GET_TAINT(bug), LOCKDEP_STILL_OK);
170 return BUG_TRAP_TYPE_WARN; 171 return BUG_TRAP_TYPE_WARN;
171 } 172 }
172 173
diff --git a/mm/memory.c b/mm/memory.c
index bb1369f7b9b4..bc8bec762db7 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -716,7 +716,7 @@ static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr,
716 print_symbol(KERN_ALERT "vma->vm_file->f_op->mmap: %s\n", 716 print_symbol(KERN_ALERT "vma->vm_file->f_op->mmap: %s\n",
717 (unsigned long)vma->vm_file->f_op->mmap); 717 (unsigned long)vma->vm_file->f_op->mmap);
718 dump_stack(); 718 dump_stack();
719 add_taint(TAINT_BAD_PAGE); 719 add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
720} 720}
721 721
722static inline bool is_cow_mapping(vm_flags_t flags) 722static inline bool is_cow_mapping(vm_flags_t flags)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index df2022ff0c8a..4c99cb7e276a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -320,7 +320,7 @@ static void bad_page(struct page *page)
320out: 320out:
321 /* Leave bad fields for debug, except PageBuddy could make trouble */ 321 /* Leave bad fields for debug, except PageBuddy could make trouble */
322 reset_page_mapcount(page); /* remove PageBuddy */ 322 reset_page_mapcount(page); /* remove PageBuddy */
323 add_taint(TAINT_BAD_PAGE); 323 add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
324} 324}
325 325
326/* 326/*
diff --git a/mm/slab.c b/mm/slab.c
index e7667a3584bc..856e4a192d25 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -812,7 +812,7 @@ static void __slab_error(const char *function, struct kmem_cache *cachep,
812 printk(KERN_ERR "slab error in %s(): cache `%s': %s\n", 812 printk(KERN_ERR "slab error in %s(): cache `%s': %s\n",
813 function, cachep->name, msg); 813 function, cachep->name, msg);
814 dump_stack(); 814 dump_stack();
815 add_taint(TAINT_BAD_PAGE); 815 add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
816} 816}
817#endif 817#endif
818 818
diff --git a/mm/slub.c b/mm/slub.c
index ba2ca53f6c3a..7ec3041bdd0d 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -562,7 +562,7 @@ static void slab_bug(struct kmem_cache *s, char *fmt, ...)
562 printk(KERN_ERR "----------------------------------------" 562 printk(KERN_ERR "----------------------------------------"
563 "-------------------------------------\n\n"); 563 "-------------------------------------\n\n");
564 564
565 add_taint(TAINT_BAD_PAGE); 565 add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
566} 566}
567 567
568static void slab_fix(struct kmem_cache *s, char *fmt, ...) 568static void slab_fix(struct kmem_cache *s, char *fmt, ...)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2370063b5824..4c6526c0db03 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -251,7 +251,7 @@ static ssize_t codec_reg_write_file(struct file *file,
251 return -EINVAL; 251 return -EINVAL;
252 252
253 /* Userspace has been fiddling around behind the kernel's back */ 253 /* Userspace has been fiddling around behind the kernel's back */
254 add_taint(TAINT_USER); 254 add_taint(TAINT_USER, LOCKDEP_NOW_UNRELIABLE);
255 255
256 snd_soc_write(codec, reg, value); 256 snd_soc_write(codec, reg, value);
257 return buf_size; 257 return buf_size;