Re: 2.6.17-rc5-mm1 - output of lock validator

From: Herbert Xu
Date: Thu Jun 01 2006 - 04:08:46 EST


On Wed, May 31, 2006 at 09:24:12PM +0000, Arjan van de Ven wrote:
>
> misrouted_irq() in kernel/irq/spurious.c
> afaics that calls all handlers registered to the system regardless of what
> irq number they are registered for.....
>
> which breaks the disable_irq() locking trick... because your irq handler now
> gets called anyway!

This is a serious bug in misrouted_irq(). disable_irq() is a software
state and must be repsected.

[IRQ]: Check IRQ_DISABLED in misrouted_irq

The misrouted interrupt function didn't check the IRQ_DISABLED flag
before calling the handlers. This is highly undesirable as handlers
are usually disabled for a good reason.

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index 7df9abd..0540b72 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -31,6 +31,10 @@ static int misrouted_irq(int irq, struct
continue;
desc = &irq_desc[i];
spin_lock(&desc->lock);
+ if (desc->status & IRQ_DISABLED) {
+ spin_unlock(&desc->lock);
+ continue;
+ }
action = desc->action;
/* Already running on another processor */
if (desc->status & IRQ_INPROGRESS) {