Re: Taint kernel after WARN_ON(condition) v2

From: Paul Mundt
Date: Fri May 16 2008 - 00:53:25 EST


On Thu, May 15, 2008 at 04:51:34PM -0700, Andrew Morton wrote:
> On Thu, 15 May 2008 13:06:35 +0900
> Paul Mundt <lethal@xxxxxxxxxxxx> wrote:
>
> > On Wed, Feb 13, 2008 at 03:55:20PM +0100, Haavard Skinnemoen wrote:
> > > On Wed, 13 Feb 2008 22:27:40 +0800
> > > Nur Hussein <nurhussein@xxxxxxxxx> wrote:
> > >
> > > > This does not work on architectures where WARN_ON has its own definition.
> > > > These archs are:
> > > > 1. s390
> > > > 2. superh
> > > > 3. avr32
> > > > 4. parisc
> > >
> > > Hmm. Relying on the generic code in lib/bug.c qualifies as "own
> > > definition" these days? I think the patch below should take care of all
> > > four...unless I've misunderstood something.
> > >
> > > Signed-off-by: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>
> > >
> > > diff --git a/lib/bug.c b/lib/bug.c
> > > index 530f38f..0d67419 100644
> > > --- a/lib/bug.c
> > > +++ b/lib/bug.c
> > > @@ -35,6 +35,7 @@
> > >
> > > Jeremy Fitzhardinge <jeremy@xxxxxxxx> 2006
> > > */
> > > +#include <linux/kernel.h>
> > > #include <linux/list.h>
> > > #include <linux/module.h>
> > > #include <linux/bug.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;
> > > }
> > >
> >
> > I was just about to submit the exact same patch, so it looks like this
> > slipped through the cracks. Andrew, please apply.
>
> <goes dumpster-diving through lkml history>
>
> > Acked-by: Paul Mundt <lethal@xxxxxxxxxxxx>
>
> I'd have ducked that one partly because of lack of changelog but mainly
> because it didn't look like anyone tested it.
>
> It's hard to see how it could go wrong, but stranger things have
> happened. To me. Regularly :(
>
It will work on any platform that implements warning traps through the
report_bug() path (ie, both report_bug() calling and BUG_TRAP_TYPE_WARN
checking), which is all of the platforms listed by Nur in his initial
comment as well as powerpc. And it's at least been verified on avr32 and
sh.

Either Havaard or I can resubmit this with a proper changelog if that
will help move things along, obviously it's not a very pressing patch one
way or the other, but consistency is good, and we're all likely to forget
about this again otherwise.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/