linux-stable/drivers/staging/rtl8192u
Duoming Zhou 6a0c054930 staging: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callback
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>
2022-07-11 10:05:35 +02:00
..
ieee80211 staging: rtl8192u: remove null check after call container_of() 2022-05-19 17:42:53 +02:00
authors
changes
Kconfig
Makefile
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: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callback 2022-07-11 10:05:35 +02:00
r8192U_core.c staging: rtl8192u: make const array queuetopipe const, reduces object code size 2022-05-19 17:40:44 +02:00
r8192U_dm.c staging: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callback 2022-07-11 10:05:35 +02:00
r8192U_dm.h staging: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callback 2022-07-11 10:05:35 +02:00
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