mirror_ubuntu-kernels/drivers/isdn/hardware/mISDN
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
..
avmfritz.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hfc_multi_8xx.h treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hfc_multi.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hfc_pci.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 153 2019-05-30 11:26:32 -07:00
hfcmulti.c mISDN: remove unused vpm_read_address and cpld_read_reg functions 2023-03-24 19:09:57 -07:00
hfcpci.c mISDN: hfcpci: Fix potential deadlock on &hc->lock 2023-07-28 18:49:28 -07:00
hfcsusb.c mISDN: hfcsusb: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave() 2022-12-13 19:24:52 -08:00
hfcsusb.h isdn: hfcsusb: Spelling and grammar fixes 2019-10-28 13:42:36 -07:00
iohelper.h isdn: remove extra spaces in the header file 2021-03-11 18:23:55 -08:00
ipac.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 176 2019-05-30 11:29:19 -07:00
isar.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 176 2019-05-30 11:29:19 -07:00
isdnhdlc.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
isdnhdlc.h isdn: deprecate non-mISDN drivers 2019-06-02 17:48:58 -07:00
Kconfig mISDN: add HAS_IOPORT dependencies 2023-05-31 19:17:40 +01:00
Makefile isdn: hdlc: move into mISDN 2019-05-31 11:13:10 +02:00
mISDNinfineon.c isdn: mISDNinfineon: check/cleanup ioremap failure correctly in setup_io 2021-05-13 18:32:06 +02:00
mISDNipac.c mISDN: fix typo "frame to short" -> "frame too short" 2022-03-21 13:26:38 +00:00
mISDNisar.c mISDN: fix typo "frame to short" -> "frame too short" 2022-03-21 13:26:38 +00:00
netjet.c isdn: mISDN: netjet: Remove redundant pci_clear_master 2023-03-24 09:13:42 +00:00
netjet.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 176 2019-05-30 11:29:19 -07:00
speedfax.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 176 2019-05-30 11:29:19 -07:00
w6692.c Printk changes for 5.5 2019-11-25 19:40:40 -08:00
w6692.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 176 2019-05-30 11:29:19 -07:00