android_kernel_motorola_sm6225/drivers/atm
Chengfeng Ye 4b7e76b9d8 atm: solos-pci: Fix potential deadlock on &tx_queue_lock
[ Upstream commit 15319a4e8ee4b098118591c6ccbd17237f841613 ]

As &card->tx_queue_lock is acquired under softirq context along the
following call chain from solos_bh(), other acquisition of the same
lock inside process context should disable at least bh to avoid double
lock.

<deadlock #2>
pclose()
--> spin_lock(&card->tx_queue_lock)
<interrupt>
   --> solos_bh()
   --> fpga_tx()
   --> spin_lock(&card->tx_queue_lock)

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

To prevent the potential deadlock, the patch uses spin_lock_bh()
on &card->tx_queue_lock under process context code consistently to
prevent the possible deadlock scenario.

Fixes: 213e85d389 ("solos-pci: clean up pclose() function")
Signed-off-by: Chengfeng Ye <dg573847474@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-20 15:38:00 +01:00
..
.gitignore
adummy.c
ambassador.c
ambassador.h
atmtcp.c atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent 2020-08-11 15:32:33 +02:00
eni.c atm: eni: Add check for dma_map_single 2022-03-23 09:10:44 +01:00
eni.h
firestream.c atm: firestream: check the return value of ioremap() in fs_init() 2022-03-23 09:10:41 +01:00
firestream.h
fore200e.c fore200e: Fix incorrect checks of NULL pointer dereference 2020-02-24 08:34:42 +01:00
fore200e.h
he.c atm: he: fix sign-extension overflow on large shift 2019-02-27 10:08:57 +01:00
he.h
horizon.c
horizon.h
idt77105.c atm: idt77252: fix null-ptr-dereference 2021-03-30 14:36:58 +02:00
idt77105.h
idt77252.c atm: idt77252: fix kmemleak when rmmod idt77252 2023-04-05 11:15:34 +02:00
idt77252.h
idt77252_tables.h
iphase.c atm: iphase: Do PCI error checks on own line 2023-11-28 16:46:32 +00:00
iphase.h
Kconfig Kconfig: Fix the reference to the IDT77105 Phy driver in the description of ATM_NICSTAR_USE_IDT77105 2019-09-21 07:16:57 +02:00
lanai.c atm: lanai: dont run lanai_dev_close if not open 2021-03-30 14:36:57 +02:00
Makefile
midway.h
nicstar.c atm: nicstar: register the interrupt handler in the right place 2021-07-20 16:16:01 +02:00
nicstar.h
nicstarmac.c
nicstarmac.copyright
solos-attrlist.c
solos-pci.c atm: solos-pci: Fix potential deadlock on &tx_queue_lock 2023-12-20 15:38:00 +01:00
suni.c
suni.h
tonga.h
uPD98401.h
uPD98402.c atm: uPD98402: fix incorrect allocation 2021-03-30 14:36:58 +02:00
uPD98402.h
zatm.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
zatm.h
zeprom.h