genirq: Fix race in register_irq_proc()
authorBen Hutchings <ben@decadent.org.uk>
Sat, 26 Sep 2015 11:23:56 +0000 (12:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Oct 2015 21:37:53 +0000 (14:37 -0700)
commit8938c10543801cbb9d85efd3f317184e405b45bc
treebabbc06820699c8d50a00a597d46250ff062016e
parente9346b9a2f5cd4ff470ee58d1bf271d0a2ca27a0
genirq: Fix race in register_irq_proc()

commit 95c2b17534654829db428f11bcf4297c059a2a7e upstream.

Per-IRQ directories in procfs are created only when a handler is first
added to the irqdesc, not when the irqdesc is created.  In the case of
a shared IRQ, multiple tasks can race to create a directory.  This
race condition seems to have been present forever, but is easier to
hit with async probing.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Link: http://lkml.kernel.org/r/1443266636.2004.2.camel@decadent.org.uk
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/irq/proc.c