linux-stable/drivers/staging/rtl8192e
Duoming Zhou 9b6bdbd933 drivers: staging: rtl8192e: Fix deadlock in rtllib_beacons_stop()
There is a deadlock in rtllib_beacons_stop(), which is shown
below:

   (Thread 1)              |      (Thread 2)
                           | rtllib_send_beacon()
rtllib_beacons_stop()      |  mod_timer()
 spin_lock_irqsave() //(1) |  (wait a time)
 ...                       | rtllib_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, rtllib_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/20220417141641.124388-1-duoming@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-20 18:47:24 +02:00
..
rtl8192e staging: rtl8192e: Fix use after free in _rtl92e_pci_disconnect() 2021-11-17 14:08:57 +01:00
dot11d.c
dot11d.h
Kconfig staging: rtl8192e: fix kconfig dependency on CRYPTO 2021-03-10 09:23:28 +01:00
Makefile
rtl819x_BA.h staging: rtl8192e: reformat ba_record struct 2021-03-10 09:25:28 +01:00
rtl819x_BAProc.c staging: rtl8192e: remove multiple blank lines 2022-04-07 19:52:39 +02:00
rtl819x_HT.h staging: rtl8192e: reformat bss_ht struct 2021-03-10 09:25:30 +01:00
rtl819x_HTProc.c staging: rtl8192e: replace comparison to NULL by bool 2021-05-10 11:19:34 +02:00
rtl819x_Qos.h
rtl819x_TS.h staging: rtl8192e: reformat rx_ts_record struct 2021-03-10 09:25:32 +01:00
rtl819x_TSProc.c staging: rtl8192e: remove unnecessary blank line before brace 2021-04-14 10:30:55 +02:00
rtllib.h staging/rtl8192e,ieee80211: replace ps tasklet with work 2022-04-12 15:53:51 +02:00
rtllib_crypt_ccmp.c staging: rtl8192e: Avoid field-overflowing memcpy() 2021-08-10 12:09:32 +02:00
rtllib_crypt_tkip.c staging: rtl8192e: indent statement properly 2021-04-22 10:38:42 +02:00
rtllib_crypt_wep.c
rtllib_debug.h staging: rtl8192e: use BIT macro instead of left shifting 2022-02-21 18:13:37 +01:00
rtllib_module.c staging: rtl8192e: rtllib_module: remove unnecessary assignment 2021-12-03 15:09:49 +01:00
rtllib_rx.c staging/rtl8192e,ieee80211: replace ps tasklet with work 2022-04-12 15:53:51 +02:00
rtllib_softmac.c drivers: staging: rtl8192e: Fix deadlock in rtllib_beacons_stop() 2022-04-20 18:47:24 +02:00
rtllib_softmac_wx.c staging/rtl8192e: Remove all strcpy() uses 2021-07-27 15:20:56 +02:00
rtllib_tx.c staging: rtl8192e: Fix shadowed variable name 2021-05-25 18:23:32 +02:00
rtllib_wx.c staging: rtl8192e: remove unnecesasry ftrace-like logging 2021-05-10 11:19:34 +02:00
TODO