linux-stable/drivers/staging
Duoming Zhou 46c861009b drivers: staging: rtl8192e: Fix deadlock in rtllib_beacons_stop()
[ Upstream commit 9b6bdbd933 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-14 18:41:34 +02:00
..
android
axis-fifo staging: axis-fifo: Use platform_get_irq() to get the interrupt 2021-12-30 11:54:56 +01:00
board
clocking-wizard
emxx_udc
fbtft staging: fbtft: fb_st7789v: reset display before initialization 2022-02-15 17:14:22 +01:00
fieldbus staging: fieldbus: Fix the error handling path in anybuss_host_common_probe() 2022-06-14 18:41:14 +02:00
fwserial
gdm724x staging: gdm724x: fix use after free in gdm_lte_rx() 2022-03-01 22:42:32 +01:00
greybus staging: greybus: codecs: fix type confusion of list iterator variable 2022-06-14 18:41:12 +02:00
gs_fpgaboot
iio staging:iio:adc:ad7280a: Fix handing of device address bit reversing. 2022-04-08 13:58:25 +02:00
ks7010
media media: rkvdec: h264: Fix bit depth wrap in pps packet 2022-06-09 10:25:54 +02:00
most staging: most: dim2: use consistent routine naming 2021-12-28 17:10:13 +01:00
mt7621-dts staging: mt7621-dts: fix pinctrl-0 items to be size-1 items on ethernet 2022-04-08 13:58:59 +02:00
nvec
octeon
octeon-usb
olpc_dcon
pi433 staging: pi433: add comment to rx_lock mutex definition 2022-01-06 15:00:29 +01:00
qlge staging: qlge: add unregister_netdev in qlge_probe 2022-04-08 13:58:24 +02:00
r8188eu staging: r8188eu: add check for kzalloc 2022-06-14 18:41:18 +02:00
rtl8192e drivers: staging: rtl8192e: Fix deadlock in rtllib_beacons_stop() 2022-06-14 18:41:34 +02:00
rtl8192u drivers: staging: rtl8192u: Fix deadlock in ieee80211_beacons_stop() 2022-06-14 18:41:34 +02:00
rtl8712 staging: rtl8712: fix a potential memory leak in r871xu_drv_init() 2022-06-14 18:41:33 +02:00
rtl8723bs drivers: staging: rtl8192bs: Fix deadlock in rtw_joinbss_event_prehandle() 2022-06-14 18:41:33 +02:00
rts5208 exit: Rename complete_and_exit to kthread_complete_and_exit 2021-12-13 12:04:45 -06:00
sm750fb
unisys staging: unisys: visornic: removed a blank line at the end of function 2021-11-25 17:38:53 +01:00
vc04_services staging: vchiq_core: handle NULL result of find_service_by_handle 2022-04-13 19:27:23 +02:00
vme
vt6655 staging: vt6655: drop off byRxMode var in device.h 2021-12-28 17:10:47 +01:00
vt6656
wfx staging: wfx: fix an error handling in wfx_init_common() 2022-04-13 19:27:24 +02:00
wlan-ng
Kconfig Merge 5.16-rc3 into staging-next 2021-11-29 08:03:05 +01:00
Makefile Merge 5.16-rc3 into staging-next 2021-11-29 08:03:05 +01:00