linux-stable/drivers/staging/rtl8192u
Duoming Zhou ffc9cab724 drivers: staging: rtl8192u: Fix deadlock in ieee80211_beacons_stop()
[ Upstream commit 806c7b5341 ]

There is a deadlock in ieee80211_beacons_stop(), which is shown below:

   (Thread 1)              |      (Thread 2)
                           | ieee80211_send_beacon()
ieee80211_beacons_stop()   |  mod_timer()
 spin_lock_irqsave() //(1) |  (wait a time)
 ...                       | ieee80211_send_beacon_cb()
 del_timer_sync()          |  spin_lock_irqsave() //(2)
 (wait timer to stop)      |  ...

We hold ieee->beacon_lock in position (1) of thread 1 and use
del_timer_sync() to wait timer to stop, but timer handler
also need ieee->beacon_lock in position (2) of thread 2.
As a result, ieee80211_beacons_stop() will block forever.

This patch extracts del_timer_sync() from the protection of
spin_lock_irqsave(), which could let timer handler to obtain
the needed lock.

Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/20220417135407.109536-1-duoming@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-14 18:41:34 +02:00
..
ieee80211 drivers: staging: rtl8192u: Fix deadlock in ieee80211_beacons_stop() 2022-06-14 18:41:34 +02:00
Kconfig staging: rtl819x: select CONFIG_CRC32 2021-01-05 15:27:22 +01:00
Makefile
authors
changes
r819xU_cmdpkt.c staging: r819xU_cmdpkt: Remove functionless method 'cmpk_handle_query_config_rx' 2021-05-10 11:19:23 +02:00
r819xU_cmdpkt.h
r819xU_firmware.c
r819xU_firmware.h
r819xU_firmware_img.c
r819xU_firmware_img.h
r819xU_phy.c staging/rtl8192u: Prefer kcalloc over open coded arithmetic 2021-08-26 12:14:27 +02:00
r819xU_phy.h
r819xU_phyreg.h
r8180_93cx6.c
r8180_93cx6.h
r8190_rtl8256.c staging: rtl8192u: remove unnecessary return in r8190_rtl8256.c 2021-03-10 09:25:26 +01:00
r8190_rtl8256.h
r8192U.h staging: rtl: use eth_hw_addr_set() 2021-10-20 19:33:59 +02:00
r8192U_core.c staging: rtl8192u: make array queuetopipe static const 2021-12-03 15:08:50 +01:00
r8192U_dm.c staging: rtl8192u: Fixed warnings of coding style 2021-05-27 13:01:04 +02:00
r8192U_dm.h
r8192U_hw.h staging: rtl8192u: fix spaces in r8192U_hw.h 2021-06-03 15:59:18 +02:00
r8192U_wx.c r8192U_wx.c: style: avoid multiple blank lines 2021-03-26 15:01:16 +01:00
r8192U_wx.h