lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 Mar 2009 11:31:22 -0700
From:	David Brownell <david-b@...bell.net>
To:	felipe.balbi@...ia.com
Cc:	Ingo Molnar <mingo@...e.hu>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	"me@...ipebalbi.com" <me@...ipebalbi.com>,
	"dmitry.torokhov@...il.com" <dmitry.torokhov@...il.com>,
	"sameo@...nedhand.com" <sameo@...nedhand.com>
Subject: Re: [patch/rfc 1/2] GENIRQ: add handle_threaded_irq() flow handler

On Wednesday 18 March 2009, Felipe Balbi wrote:
> > +     action = desc->action;
> > +     if (unlikely(!action || (desc->status & IRQ_DISABLED)))
> > +             goto out_unlock;
> 
> you say below irqs are always enabled

Right here they're always disabled by spin_lock_irq().
The "below" follows spin_unlock_irq(), which re-enables
them to traverse that (locked) action list.


> so this branch is something we 
> never want to happen. How about adding a WARN() then ?

When some one says "irqs are enabled" they mean that,
local_irq_disable() or friends have not been called,
so for example a timer or other IRQ could arrive.

The IRQ_DISABLED flag in an IRQ descriptor means
something different:  "don't try *handling* this".

That particular check is used in *ALL* flow handlers.
It guards against things like races in disable_irq()
paths, which could allow an IRQ that was in flight
to arrive "after" the IRQ was disabled.

In the case of an IRQ enable/disable mask sitting
across an I2C bus boundary, it's particularly easy
to see how such a race might happen ... since both
the thread masking the IRQ, and the one handling it,
are subject to preemption and scheduling.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ