genirq: Fix race in register_irq_proc()
authorBen Hutchings <ben@decadent.org.uk>
Sat, 26 Sep 2015 11:23:56 +0000 (12:23 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 17 Nov 2015 15:54:41 +0000 (15:54 +0000)
commitbde3a53c6f76c4b3ee2635336ebf0c018607eba7
tree2ded1c1c90e5b2d35a3fa86d6bae353827e14011
parent5311d93d0d33ae878d5fbb35ea5693b9c813ba04
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>
kernel/irq/proc.c