linux-stable/drivers/staging
Duoming Zhou e3a1eaea66 staging: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callback
[ Upstream commit 6a0c054930 ]

There are sleep in atomic context bugs when dm_fsync_timer_callback is
executing. The root cause is that the memory allocation functions with
GFP_KERNEL or GFP_NOIO parameters are called in dm_fsync_timer_callback
which is a timer handler. The call paths that could trigger bugs are
shown below:

    (interrupt context)
dm_fsync_timer_callback
  write_nic_byte
    kzalloc(sizeof(data), GFP_KERNEL); //may sleep
    usb_control_msg
      kmalloc(.., GFP_NOIO); //may sleep
  write_nic_dword
    kzalloc(sizeof(data), GFP_KERNEL); //may sleep
    usb_control_msg
      kmalloc(.., GFP_NOIO); //may sleep

This patch uses delayed work to replace timer and moves the operations
that may sleep into the delayed work in order to mitigate bugs.

Fixes: 8fc8598e61 ("Staging: Added Realtek rtl8192u driver to staging")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/20220710103002.63283-1-duoming@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-17 14:23:50 +02:00
..
android
axis-fifo
board
clocking-wizard
emxx_udc
fbtft
fieldbus staging: fieldbus: Fix the error handling path in anybuss_host_common_probe() 2022-06-14 18:36:04 +02:00
fwserial
gdm724x
greybus staging: greybus: codecs: fix type confusion of list iterator variable 2022-06-14 18:36:02 +02:00
gs_fpgaboot
iio staging:iio:adc:ad7280a: Fix handing of device address bit reversing. 2022-04-08 14:23:45 +02:00
ks7010
media media: cedrus: hevc: Add check for invalid timestamp 2022-08-17 14:23:34 +02:00
most
mt7621-dma
mt7621-dts staging: mt7621-dts: fix pinctrl-0 items to be size-1 items on ethernet 2022-04-08 14:24:13 +02:00
mt7621-pci
netlogic
nvec
octeon
octeon-usb
olpc_dcon
pi433
qlge
r8188eu staging: r8188eu: Fix warning of array overflow in ioctl_linux.c 2022-06-22 14:21:59 +02:00
ralink-gdma
rtl8192e drivers: staging: rtl8192e: Fix deadlock in rtllib_beacons_stop() 2022-06-14 18:36:20 +02:00
rtl8192u staging: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callback 2022-08-17 14:23:50 +02:00
rtl8712 staging: rtl8712: fix uninit-value in r871xu_drv_init() 2022-06-14 18:36:22 +02:00
rtl8723bs drivers: staging: rtl8192bs: Fix deadlock in rtw_joinbss_event_prehandle() 2022-06-14 18:36:20 +02:00
rts5208
sm750fb
unisys
vc04_services staging: vchiq_core: handle NULL result of find_service_by_handle 2022-04-13 20:59:11 +02:00
vme
vt6655
vt6656
wfx staging: wfx: fix an error handling in wfx_init_common() 2022-04-13 20:59:11 +02:00
wlan-ng
Kconfig
Makefile