Skip to content

Commit

Permalink
[PATCH] lockdep: disable lock debugging when kernel state becomes unt…
Browse files Browse the repository at this point in the history
…rusted

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 <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
fenrus75 authored and Linus Torvalds committed Jul 10, 2006
1 parent e54695a commit 2c16e9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ const char *print_tainted(void)

void add_taint(unsigned flag)
{
debug_locks_off(); /* can't trust the integrity of the kernel anymore */
tainted |= flag;
}
EXPORT_SYMBOL(add_taint);
Expand Down Expand Up @@ -256,6 +257,7 @@ int oops_may_print(void)
*/
void oops_enter(void)
{
debug_locks_off(); /* can't trust the integrity of the kernel anymore */
do_oops_enter_exit();
}

Expand Down

0 comments on commit 2c16e9c

Please sign in to comment.