mirror_ubuntu-kernels/drivers/net/wireless
Johan Hovold d4ba1ff87b ath11k: fix netdev open race
Make sure to allocate resources needed before registering the device.

This specifically avoids having a racing open() trigger a BUG_ON() in
mod_timer() when ath11k_mac_op_start() is called before the
mon_reap_timer as been set up.

I did not see this issue with next-20220310, but I hit it on every probe
with next-20220511. Perhaps some timing changed in between.

Here's the backtrace:

[   51.346947] kernel BUG at kernel/time/timer.c:990!
[   51.346958] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
...
[   51.578225] Call trace:
[   51.583293]  __mod_timer+0x298/0x390
[   51.589518]  mod_timer+0x14/0x20
[   51.595368]  ath11k_mac_op_start+0x41c/0x4a0 [ath11k]
[   51.603165]  drv_start+0x38/0x60 [mac80211]
[   51.610110]  ieee80211_do_open+0x29c/0x7d0 [mac80211]
[   51.617945]  ieee80211_open+0x60/0xb0 [mac80211]
[   51.625311]  __dev_open+0x100/0x1c0
[   51.631420]  __dev_change_flags+0x194/0x210
[   51.638214]  dev_change_flags+0x24/0x70
[   51.644646]  do_setlink+0x228/0xdb0
[   51.650723]  __rtnl_newlink+0x460/0x830
[   51.657162]  rtnl_newlink+0x4c/0x80
[   51.663229]  rtnetlink_rcv_msg+0x124/0x390
[   51.669917]  netlink_rcv_skb+0x58/0x130
[   51.676314]  rtnetlink_rcv+0x18/0x30
[   51.682460]  netlink_unicast+0x250/0x310
[   51.688960]  netlink_sendmsg+0x19c/0x3e0
[   51.695458]  ____sys_sendmsg+0x220/0x290
[   51.701938]  ___sys_sendmsg+0x7c/0xc0
[   51.708148]  __sys_sendmsg+0x68/0xd0
[   51.714254]  __arm64_sys_sendmsg+0x28/0x40
[   51.720900]  invoke_syscall+0x48/0x120

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3

Fixes: d5c65159f2 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Fixes: 840c36fa72 ("ath11k: dp: stop rx pktlog before suspend")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220517103436.15867-1-johan+linaro@kernel.org
2022-05-30 14:19:40 +03:00
..
admtek
ath ath11k: fix netdev open race 2022-05-30 14:19:40 +03:00
atmel atmel: use eth_hw_addr_set() 2021-10-20 12:39:44 +03:00
broadcom brcmfmac: allow setting wlan MAC address using device tree 2022-05-11 08:27:14 +03:00
cisco airo: fix typos in comments 2022-03-16 17:30:40 +02:00
intel mac80211: prepare sta handling for MLO support 2022-04-11 16:42:03 +02:00
intersil orinoco: Prepare cleanup of powerpc's asm/prom.h 2022-04-06 15:16:08 +03:00
marvell wireless-next patches for v5.19 2022-05-03 17:27:51 -07:00
mediatek mt76 patches for 5.19 2022-05-16 13:11:58 +03:00
microchip wilc1000: add valid vmm_entry check before fetching from TX queue 2022-05-11 08:25:34 +03:00
purelifi plfxlc: fix le16_to_cpu warning for beacon_interval 2022-05-03 08:28:32 +03:00
quantenna qtnfmac: switch to netif_napi_add_weight() 2022-05-06 08:47:52 +03:00
ralink mac80211: prepare sta handling for MLO support 2022-04-11 16:42:03 +02:00
realtek rtlwifi: Use pr_warn instead of WARN_ONCE 2022-05-13 09:19:44 +03:00
rsi mac80211: prepare sta handling for MLO support 2022-04-11 16:42:03 +02:00
silabs wfx: use container_of() to get vif 2022-05-11 08:32:57 +03:00
st mac80211: prepare sta handling for MLO support 2022-04-11 16:42:03 +02:00
ti wl1251: dynamically allocate memory used for DMA 2022-05-06 09:11:33 +03:00
zydas zd1201: use kzalloc 2022-03-16 17:28:40 +02:00
Kconfig wireless: add plfxlc driver for pureLiFi X, XL, XC devices 2022-04-25 15:30:42 +03:00
mac80211_hwsim.c mac80211: prepare sta handling for MLO support 2022-04-11 16:42:03 +02:00
mac80211_hwsim.h
Makefile wireless: add plfxlc driver for pureLiFi X, XL, XC devices 2022-04-25 15:30:42 +03:00
ray_cs.c ray_cs: Check ioremap return value 2022-02-01 14:24:35 +02:00
ray_cs.h
rayctl.h
rndis_wlan.c
virt_wifi.c
wl3501_cs.c wl3501_cs: use eth_hw_addr_set() 2021-10-20 12:39:47 +03:00
wl3501.h