Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcdcd8e7 authored by Pavel Emelianov's avatar Pavel Emelianov Committed by Linus Torvalds
Browse files

Report that kernel is tainted if there was an OOPS



If the kernel OOPSed or BUGed then it probably should be considered as
tainted.  Thus, all subsequent OOPSes and SysRq dumps will report the
tainted kernel.  This saves a lot of time explaining oddities in the
calltraces.

Signed-off-by: default avatarPavel Emelianov <xemul@openvz.org>
Acked-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
[ Added parisc patch from Matthew Wilson  -Linus ]
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 74489a91
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -251,6 +251,8 @@ characters, each representing a particular tainted value.
  7: 'U' if a user or user application specifically requested that the
     Tainted flag be set, ' ' otherwise.

  8: 'D' if the kernel has died recently, i.e. there was an OOPS or BUG.

The primary reason for the 'Tainted: ' string is to tell kernel
debuggers if this is a clean kernel or if anything unusual has
occurred.  Tainting is permanent: even if an offending module is
+1 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15)
#endif
	printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err);
	dik_show_regs(regs, r9_15);
	add_taint(TAINT_DIE);
	dik_show_trace((unsigned long *)(regs+1));
	dik_show_code((unsigned int *)regs->pc);

+1 −0
Original line number Diff line number Diff line
@@ -249,6 +249,7 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
	bust_spinlocks(1);
	__die(str, err, thread, regs);
	bust_spinlocks(0);
	add_taint(TAINT_DIE);
	spin_unlock_irq(&die_lock);

	if (in_interrupt())
+1 −0
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
	printk("Internal error: %s: %x\n", str, err);
	printk("CPU: %d\n", smp_processor_id());
	show_regs(regs);
	add_taint(TAINT_DIE);
	printk("Process %s (pid: %d, stack limit = 0x%p)\n",
		current->comm, current->pid, end_of_stack(tsk));

+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ void NORET_TYPE die(const char *str, struct pt_regs *regs, long err)
	show_regs_log_lvl(regs, KERN_EMERG);
	show_stack_log_lvl(current, regs->sp, regs, KERN_EMERG);
	bust_spinlocks(0);
	add_taint(TAINT_DIE);
	spin_unlock_irq(&die_lock);

	if (in_interrupt())
Loading