linux-stable/drivers/isdn
Chengfeng Ye 56c6be35fc mISDN: hfcpci: Fix potential deadlock on &hc->lock
As &hc->lock is acquired by both timer _hfcpci_softirq() and hardirq
hfcpci_int(), the timer should disable irq before lock acquisition
otherwise deadlock could happen if the timmer is preemtped by the hadr irq.

Possible deadlock scenario:
hfcpci_softirq() (timer)
    -> _hfcpci_softirq()
    -> spin_lock(&hc->lock);
        <irq interruption>
        -> hfcpci_int()
        -> spin_lock(&hc->lock); (deadlock here)

This flaw was found by an experimental static analysis tool I am developing
for irq-related deadlock.

The tentative patch fixes the potential deadlock by spin_lock_irq()
in timer.

Fixes: b36b654a7e ("mISDN: Create /sys/class/mISDN")
Signed-off-by: Chengfeng Ye <dg573847474@gmail.com>
Link: https://lore.kernel.org/r/20230727085619.7419-1-dg573847474@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-07-28 18:49:28 -07:00
..
capi driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
hardware mISDN: hfcpci: Fix potential deadlock on &hc->lock 2023-07-28 18:49:28 -07:00
mISDN Including fixes from netfilter. 2023-05-05 19:12:01 -07:00
Kconfig mISDN: add HAS_IOPORT dependencies 2023-05-31 19:17:40 +01:00
Makefile isdn: capi: dead code removal 2019-12-11 09:12:38 +01:00