android_kernel_samsung_a7y1.../kernel/irq
Edward Cree d865177b81 genirq: Fix reference leaks on irq affinity notifiers
commit df81dfcfd6991d547653d46c051bac195cd182c1 upstream.

The handling of notify->work did not properly maintain notify->kref in two
 cases:
1) where the work was already scheduled, another irq_set_affinity_locked()
   would get the ref and (no-op-ly) schedule the work.  Thus when
   irq_affinity_notify() ran, it would drop the original ref but not the
   additional one.
2) when cancelling the (old) work in irq_set_affinity_notifier(), if there
   was outstanding work a ref had been got for it but was never put.
Fix both by checking the return values of the work handling functions
 (schedule_work() for (1) and cancel_work_sync() for (2)) and put the
 extra ref if the return value indicates preexisting work.

Fixes: cd7eab44e994 ("genirq: Add IRQ affinity notifiers")
Fixes: 59c39840f5ab ("genirq: Prevent use-after-free and work list corruption")
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ben Hutchings <ben@decadent.org.uk>
Link: https://lkml.kernel.org/r/24f5983f-2ab5-e83a-44ee-a45b5f9300f5@solarflare.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 14:24:20 +02:00
..
autoprobe.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
chip.c genirq: Respect IRQCHIP_SKIP_SET_WAKE in irq_chip_set_wake_parent() 2020-04-06 15:08:26 +02:00
cpuhotplug.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
debug.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
devres.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dummychip.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
generic-chip.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
handle.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
internals.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
irqdesc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
irqdomain.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
manage.c genirq: Fix reference leaks on irq affinity notifiers 2020-04-07 14:24:20 +02:00
migration.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
msi.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pm.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
proc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
resend.c genirq: Prevent NULL pointer dereference in resend_irqs() 2020-04-06 21:35:35 +02:00
settings.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
spurious.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30