aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/panic.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2006-07-10 07:45:42 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-10 16:24:27 -0400
commit2c16e9c888985761511bd1905b00fb271169c3c0 (patch)
treee17756b3ed27b0f4953547c39cf46864cdd6f818 /kernel/panic.c
parente54695a59c278b9ff48cd4b263da7a1d392f5061 (diff)
[PATCH] lockdep: disable lock debugging when kernel state becomes untrusted
Disable lockdep debugging in two situations where the integrity of the kernel no longer is guaranteed: when oopsing and when hitting a tainting-condition. The goal is to not get weird lockdep traces that don't make sense or are otherwise undebuggable, to not waste time. Lockdep assumes that the previous state it knows about is valid to operate, which is why lockdep turns itself off after the first violation it reports, after that point it can no longer make that assumption. A kernel oops means that the integrity of the kernel compromised; in addition anything lockdep would report is of lesser importance than the oops. All the tainting conditions are of similar integrity-violating nature and also make debugging/diagnosing more difficult. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/panic.c')
-rw-r--r--kernel/panic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index ab13f0f668b5..d8a0bca21233 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -172,6 +172,7 @@ const char *print_tainted(void)
172 172
173void add_taint(unsigned flag) 173void add_taint(unsigned flag)
174{ 174{
175 debug_locks_off(); /* can't trust the integrity of the kernel anymore */
175 tainted |= flag; 176 tainted |= flag;
176} 177}
177EXPORT_SYMBOL(add_taint); 178EXPORT_SYMBOL(add_taint);
@@ -256,6 +257,7 @@ int oops_may_print(void)
256 */ 257 */
257void oops_enter(void) 258void oops_enter(void)
258{ 259{
260 debug_locks_off(); /* can't trust the integrity of the kernel anymore */
259 do_oops_enter_exit(); 261 do_oops_enter_exit();
260} 262}
261 263