mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: hskinnemoen@atmel.com, nurhussein@gmail.com,
	linux-kernel@vger.kernel.org, randy.dunlap@oracle.com,
	arjan@infradead.org, mingo@elte.hu, a.p.zijlstra@chello.nl,
	kyle@parisc-linux.org, schwidefsky@de.ibm.com
Subject: [PATCH] lib: Taint kernel in common report_bug() WARN path.
Date: Fri, 16 May 2008 14:21:27 +0900	[thread overview]
Message-ID: <20080516052127.GB15431@linux-sh.org> (raw)

Commit 95b570c9cef3b12356454c7112571b7e406b4b51 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 <hskinnemoen@atmel.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

---

diff --git a/lib/bug.c b/lib/bug.c
index 530f38f..bfeafd6 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -37,6 +37,7 @@
  */
 #include <linux/list.h>
 #include <linux/module.h>
+#include <linux/kernel.h>
 #include <linux/bug.h>
 #include <linux/sched.h>
 
@@ -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;
 	}
 

             reply	other threads:[~2008-05-16  5:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-16  5:21 Paul Mundt [this message]
2008-05-16 14:57 ` Kyle McMartin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080516052127.GB15431@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=hskinnemoen@atmel.com \
    --cc=kyle@parisc-linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nurhussein@gmail.com \
    --cc=randy.dunlap@oracle.com \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®