WSL2-Linux-Kernel/drivers/counter
William Breathitt Gray 663d8fb0f8 counter: 104-quad-8: Fix use-after-free by quad8_irq_handler
On unbind an irq might be pending which results in quad8_irq_handler()
calling counter_push_event() for a counter that is already unregistered.
This patch fixes that situation by passing the struct counter_device dev
to devm_request_irq() rather than the parent's so that the irq handler
is cleaned before the counter is unregistered.

Fixes: 7aa2ba0df6 ("counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8")
Cc: Syed Nayyar Waris <syednwaris@gmail.com>
Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Link: https://lore.kernel.org/r/20220105093052.258791-1-vilhelm.gray@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-06 15:51:13 +01:00
..
104-quad-8.c counter: 104-quad-8: Fix use-after-free by quad8_irq_handler 2022-01-06 15:51:13 +01:00
Kconfig counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8 2021-10-17 10:55:55 +01:00
Makefile counter: Add character device interface 2021-10-17 10:53:52 +01:00
counter-chrdev.c counter: Fix use-after-free race condition for events_queue_size write 2021-10-21 13:02:47 +02:00
counter-chrdev.h counter: Add character device interface 2021-10-17 10:53:52 +01:00
counter-core.c counter: remove old and now unused registration API 2021-12-30 17:44:07 +01:00
counter-sysfs.c counter: Fix use-after-free race condition for events_queue_size write 2021-10-21 13:02:47 +02:00
counter-sysfs.h counter: Internalize sysfs interface code 2021-10-17 10:52:58 +01:00
ftm-quaddec.c counter: ftm-quaddec: Convert to new counter registration 2021-12-30 17:44:07 +01:00
intel-qep.c counter: intel-qep: Convert to new counter registration 2021-12-30 17:44:07 +01:00
interrupt-cnt.c counter: interrupt-cnt: Convert to new counter registration 2021-12-30 17:44:07 +01:00
microchip-tcb-capture.c counter: microchip-tcb-capture: Convert to new counter registration 2021-12-30 17:44:07 +01:00
stm32-lptimer-cnt.c counter: stm32-lptimer-cnt: Convert to new counter registration 2021-12-30 17:44:07 +01:00
stm32-timer-cnt.c counter: stm32-timer-cnt: Convert to new counter registration 2021-12-30 17:44:07 +01:00
ti-eqep.c counter: ti-eqep: Convert to new counter registration 2021-12-30 17:44:07 +01:00