WSL2-Linux-Kernel/drivers/staging/rtl8712
Nam Cao f49294ad68 staging: rtl8712: fix race condition
commit 1422b526fb upstream.

In probe function, request_firmware_nowait() is called to load firmware
asynchronously. At completion of firmware loading, register_netdev() is
called. However, a mutex needed by netdev is initialized after the call
to request_firmware_nowait(). Consequently, it can happen that
register_netdev() is called before the driver is ready.

Move the mutex initialization into r8712_init_drv_sw(), which is called
before request_firmware_nowait().

Reported-by: syzbot+b08315e8cf5a78eed03c@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-staging/000000000000d9d4560601b8e0d7@google.com/T/#u
Fixes: 8c213fa591 ("staging: r8712u: Use asynchronous firmware loading")
Cc: stable <stable@kernel.org>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/20230731110620.116562-1-namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-06 21:28:39 +01:00
..
Kconfig
Makefile
TODO
basic_types.h
drv_types.h
ethernet.h
hal_init.c Merge 5.14-rc5 into staging-next 2021-08-09 08:59:23 +02:00
ieee80211.c staging: rtl8712: Use constants from <linux/ieee80211.h> 2021-04-07 10:19:12 +02:00
ieee80211.h
mlme_linux.c
mlme_osdep.h drivers: staging: rtl8712: align arguments with open parenthesis 2021-04-06 14:15:56 +02:00
mp_custom_oid.h
os_intfs.c staging: rtl8712: fix race condition 2023-09-06 21:28:39 +01:00
osdep_intf.h
osdep_service.h staging: rtl8712: Fix alignment 2021-07-21 11:01:58 +02:00
recv_linux.c
recv_osdep.h
rtl871x_cmd.c
rtl871x_cmd.h staging: rtl8712: add blank lines after declarations 2021-04-05 12:12:26 +02:00
rtl871x_debug.h staging: rtl8712: Remove unnecessary alias of printk() 2021-06-09 12:11:21 +02:00
rtl871x_eeprom.c
rtl871x_eeprom.h
rtl871x_event.h staging: rtl8712: add blank lines after declarations 2021-04-05 12:12:26 +02:00
rtl871x_ht.h staging: rtl8712: remove struct rtl_ieee80211_ht_cap and ieee80211_ht_addt_info 2021-04-09 16:14:33 +02:00
rtl871x_io.c
rtl871x_io.h staging: rtl8712: Remove extra blank lines 2021-04-06 14:16:20 +02:00
rtl871x_ioctl.h
rtl871x_ioctl_linux.c staging: rtl8712: remove struct rtl_ieee80211_ht_cap and ieee80211_ht_addt_info 2021-04-09 16:14:33 +02:00
rtl871x_ioctl_rtl.c
rtl871x_ioctl_rtl.h
rtl871x_ioctl_set.c
rtl871x_ioctl_set.h
rtl871x_led.h staging: rtl8712: get rid of flush_scheduled_work 2021-07-27 15:15:24 +02:00
rtl871x_mlme.c staging: rtl8712: Use list iterators and helpers 2021-05-10 11:19:33 +02:00
rtl871x_mlme.h staging: rtl8712: Remove extra blank lines 2021-04-06 14:16:20 +02:00
rtl871x_mp.c staging: rtl8712: add blank lines after declarations 2021-04-05 12:12:26 +02:00
rtl871x_mp.h staging: rtl8712: add blank lines after declarations 2021-04-05 12:12:26 +02:00
rtl871x_mp_ioctl.c staging: rtl8712: fix the bssid in mp_start_test() 2021-05-19 16:02:51 +02:00
rtl871x_mp_ioctl.h staging: rtl8712: rtl871x_mp_ioctl: Remove a bunch of unused tables 2021-05-10 11:19:23 +02:00
rtl871x_mp_phy_regdef.h
rtl871x_pwrctrl.c staging: rtl8712: get rid of flush_scheduled_work 2021-07-27 15:15:24 +02:00
rtl871x_pwrctrl.h staging: rtl8712: get rid of flush_scheduled_work 2021-07-27 15:15:24 +02:00
rtl871x_recv.c staging: rtl8712: Fix some tests against some 'data' subtype frames 2021-05-10 11:19:34 +02:00
rtl871x_recv.h staging: rtl8712: Remove extra blank lines 2021-04-06 14:16:20 +02:00
rtl871x_rf.h
rtl871x_security.c staging: rtl8712: Fix some tests against some 'data' subtype frames 2021-05-10 11:19:34 +02:00
rtl871x_security.h staging: rtl8712: add spaces around operators 2021-04-06 14:15:39 +02:00
rtl871x_sta_mgt.c staging: rtl8712: Removed unnecessary blank lines 2021-05-25 18:23:26 +02:00
rtl871x_wlan_sme.h
rtl871x_xmit.c staging: r8712: Fix memory leak in _r8712_init_xmit_priv() 2023-08-03 10:22:43 +02:00
rtl871x_xmit.h staging: rtl8712: match parentheses alignment 2021-04-06 14:15:40 +02:00
rtl8712_bitdef.h
rtl8712_cmd.c staging: rtl8712: fix use after free bugs 2022-09-08 12:28:03 +02:00
rtl8712_cmd.h
rtl8712_cmdctrl_bitdef.h
rtl8712_cmdctrl_regdef.h
rtl8712_debugctrl_bitdef.h
rtl8712_debugctrl_regdef.h
rtl8712_edcasetting_bitdef.h
rtl8712_edcasetting_regdef.h
rtl8712_efuse.c
rtl8712_efuse.h
rtl8712_event.h
rtl8712_fifoctrl_bitdef.h
rtl8712_fifoctrl_regdef.h
rtl8712_gp_bitdef.h
rtl8712_gp_regdef.h
rtl8712_hal.h
rtl8712_interrupt_bitdef.h
rtl8712_io.c
rtl8712_led.c staging: rtl8712: get rid of flush_scheduled_work 2021-07-27 15:15:24 +02:00
rtl8712_macsetting_bitdef.h
rtl8712_macsetting_regdef.h
rtl8712_powersave_bitdef.h
rtl8712_powersave_regdef.h
rtl8712_ratectrl_bitdef.h
rtl8712_ratectrl_regdef.h
rtl8712_recv.c staging: rtl8712: remove multiple multiple assignments 2021-05-10 11:19:34 +02:00
rtl8712_recv.h staging: rtl8712: remove extra blank lines 2021-04-05 12:12:26 +02:00
rtl8712_regdef.h
rtl8712_security_bitdef.h
rtl8712_spec.h
rtl8712_syscfg_bitdef.h
rtl8712_syscfg_regdef.h
rtl8712_timectrl_bitdef.h
rtl8712_timectrl_regdef.h
rtl8712_wmac_bitdef.h
rtl8712_wmac_regdef.h staging: rtl8712: removed extra blank line 2021-04-08 09:27:59 +02:00
rtl8712_xmit.c Staging: rtl8712: Cleanup coding style warning 2021-06-03 15:57:37 +02:00
rtl8712_xmit.h
sta_info.h staging: rtl8712: Remove extra blank lines 2021-04-06 14:16:20 +02:00
usb_halinit.c
usb_intf.c staging: rtl8712: fix race condition 2023-09-06 21:28:39 +01:00
usb_ops.c staging: rtl8712: fix uninit-value in usb_read8() and friends 2022-06-14 18:36:22 +02:00
usb_ops.h staging: rtl8712: matched alignment with open parenthesis 2021-04-08 09:27:58 +02:00
usb_ops_linux.c staging: r8712u: fix control-message timeout 2021-11-12 15:05:51 +01:00
usb_osintf.h
wifi.h staging: rtl8712: Remove some unused #define and enum 2021-07-21 11:01:54 +02:00
wlan_bssdef.h staging: rtl8712: add spaces around '+' 2021-04-09 16:11:23 +02:00
xmit_linux.c staging: r8712: Fix memory leak in _r8712_init_xmit_priv() 2023-08-03 10:22:43 +02:00
xmit_osdep.h staging: rtl8712: match parentheses alignment 2021-04-06 14:15:40 +02:00