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]
Message-ID: <alpine.LFD.2.02.1203161102190.2466@ionos>
Date:	Fri, 16 Mar 2012 11:06:52 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Ido Yariv <ido@...ery.com>
cc:	Alexander Gordeev <agordeev@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [tip:irq/core] genirq: Flush the irq thread on synchronization

On Fri, 16 Mar 2012, Ido Yariv wrote:
> On Thu, Mar 15, 2012 at 08:07:56PM +0100, Alexander Gordeev wrote:
> > Nevertheless, wake_threads_waitq() gets called and desc->threads_active gets
> > decremented. As result, if desc->threads_active initially was decremented, we
> > might wrongly wake up the queue while some threaded handler is still running.
> > 
> > By contrast, if we choose not to wake up here, we might stuck in
> > synchronize_irq(). Which is probably better than a fooling synchronize_irq().
> 
> AFAICT, IRQTF_RUNTHREAD and the desc->threads_active are always modified
> together:
> desc->threads_active is incremented if and only if IRQTF_RUNTHREAD is
> set after being cleared (in irq_wake_thread()).
> desc->threads_active is decremented in wake_threads_waitq(), which is
> only called when IRQTF_RUNTHREAD is cleared.
> 
> It seems that if we get to this point, either IRQTF_RUNTHREAD is set and
> desc->threads_active was not decremented, or it is not set.
> 
> Do you see any case where the two will be out of sync?

There is really no way, that the flag is set when we come out this
regular exit path.

__free_irq()
	remove action
	synchronize_irq()
	kthread_stop()

So after the action is removed and synchronize_irq() made sure that
the thread has finished IRQTF_RUNTHREAD cannot be set. Neither can we
have a stale threads_oneshot bit set from this action.

That's a leftover of the old code and I really did not think it
through fully and kept the stuff along with paranoid warnings.

I'm going to remove all of it.

Thanks,

	tglx
--
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