Skip to content

Commit

Permalink
lib: taint kernel in common report_bug() WARN path.
Browse files Browse the repository at this point in the history
Commit 95b570c ("Taint kernel after
WARN_ON(condition)") introduced a TAINT_WARN that was implemented for
all architectures using the generic warn_on_slowpath(), which excluded
any architecture that set HAVE_ARCH_WARN_ON.

As all of the architectures that implement their own WARN_ON() all go
through the report_bug() path (specifically handling BUG_TRAP_TYPE_WARN),
taint the kernel there as well for consistency.

Tested on avr32 and sh. Also relevant for s390, parisc, and powerpc.

Signed-off-by: Haavard Skinnemoen <[email protected]>
Signed-off-by: Paul Mundt <[email protected]>
Acked-by: Kyle McMartin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
pmundt authored and torvalds committed Jul 4, 2008
1 parent c4a2d7f commit da9eac8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/bug.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
*/
#include <linux/list.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/bug.h>
#include <linux/sched.h>

Expand Down Expand Up @@ -149,6 +150,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
(void *)bugaddr);

show_regs(regs);
add_taint(TAINT_WARN);
return BUG_TRAP_TYPE_WARN;
}

Expand Down

0 comments on commit da9eac8

Please sign in to comment.