Skip to content

Commit f5d77d0

Browse files
Stone Zhanggregkh
authored andcommitted
wifi: ath11k: fix node corruption in ar->arvifs list
[ Upstream commit 31e98e2 ] In current WLAN recovery code flow, ath11k_core_halt() only reinitializes the "arvifs" list head. This will cause the list node immediately following the list head to become an invalid list node. Because the prev of that node still points to the list head "arvifs", but the next of the list head "arvifs" no longer points to that list node. When a WLAN recovery occurs during the execution of a vif removal, and it happens before the spin_lock_bh(&ar->data_lock) in ath11k_mac_op_remove_interface(), list_del() will detect the previously mentioned situation, thereby triggering a kernel panic. The fix is to remove and reinitialize all vif list nodes from the list head "arvifs" during WLAN halt. The reinitialization is to make the list nodes valid, ensuring that the list_del() in ath11k_mac_op_remove_interface() can execute normally. Call trace: __list_del_entry_valid_or_report+0xb8/0xd0 ath11k_mac_op_remove_interface+0xb0/0x27c [ath11k] drv_remove_interface+0x48/0x194 [mac80211] ieee80211_do_stop+0x6e0/0x844 [mac80211] ieee80211_stop+0x44/0x17c [mac80211] __dev_close_many+0xac/0x150 __dev_change_flags+0x194/0x234 dev_change_flags+0x24/0x6c devinet_ioctl+0x3a0/0x670 inet_ioctl+0x200/0x248 sock_do_ioctl+0x60/0x118 sock_ioctl+0x274/0x35c __arm64_sys_ioctl+0xac/0xf0 invoke_syscall+0x48/0x114 ... Tested-on: QCA6698AQ hw2.1 PCI WLAN.HSP.1.1-04591-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1 Fixes: d5c6515 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Stone Zhang <quic_stonez@quicinc.com> Link: https://patch.msgid.link/20250320053145.3445187-1-quic_stonez@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 80a8137 commit f5d77d0

File tree

1 file changed

+7
-1
lines changed
  • drivers/net/wireless/ath/ath11k

1 file changed

+7
-1
lines changed

drivers/net/wireless/ath/ath11k/core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,6 +1915,7 @@ static int ath11k_core_reconfigure_on_crash(struct ath11k_base *ab)
19151915
void ath11k_core_halt(struct ath11k *ar)
19161916
{
19171917
struct ath11k_base *ab = ar->ab;
1918+
struct list_head *pos, *n;
19181919

19191920
lockdep_assert_held(&ar->conf_mutex);
19201921

@@ -1929,7 +1930,12 @@ void ath11k_core_halt(struct ath11k *ar)
19291930

19301931
rcu_assign_pointer(ab->pdevs_active[ar->pdev_idx], NULL);
19311932
synchronize_rcu();
1932-
INIT_LIST_HEAD(&ar->arvifs);
1933+
1934+
spin_lock_bh(&ar->data_lock);
1935+
list_for_each_safe(pos, n, &ar->arvifs)
1936+
list_del_init(pos);
1937+
spin_unlock_bh(&ar->data_lock);
1938+
19331939
idr_init(&ar->txmgmt_idr);
19341940
}
19351941

0 commit comments

Comments
 (0)