Skip to content

Commit b323b7b

Browse files
Maharaja Kennadyrajansmb49
authored andcommitted
wifi: ath12k: fix node corruption in ar->arvifs list
BugLink: https://bugs.launchpad.net/bugs/2119603 [ Upstream commit 823435bd23108d6f8be89ea2d025c0e2e3769c51 ] In current WLAN recovery code flow, ath12k_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 ath12k_mac_vdev_delete(), 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 ath12k_mac_vdev_delete() can execute normally. Call trace: __list_del_entry_valid_or_report+0xd4/0x100 (P) ath12k_mac_remove_link_interface.isra.0+0xf8/0x2e4 [ath12k] ath12k_scan_vdev_clean_work+0x40/0x164 [ath12k] cfg80211_wiphy_work+0xfc/0x100 process_one_work+0x164/0x2d0 worker_thread+0x254/0x380 kthread+0xfc/0x100 ret_from_fork+0x10/0x20 The change is mostly copied from the ath11k patch: https://lore.kernel.org/all/[email protected]/ Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Fixes: d889913 ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Maharaja Kennadyrajan <[email protected]> Reviewed-by: Vasanthakumar Thiagarajan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jeff Johnson <[email protected]> Signed-off-by: Sasha Levin <[email protected]> CVE-2025-38290 Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Mehmet Basaran <[email protected]>
1 parent 282fdf1 commit b323b7b

File tree

1 file changed

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

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,7 @@ static void ath12k_rfkill_work(struct work_struct *work)
12391239

12401240
void ath12k_core_halt(struct ath12k *ar)
12411241
{
1242+
struct list_head *pos, *n;
12421243
struct ath12k_base *ab = ar->ab;
12431244

12441245
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
@@ -1254,7 +1255,12 @@ void ath12k_core_halt(struct ath12k *ar)
12541255

12551256
rcu_assign_pointer(ab->pdevs_active[ar->pdev_idx], NULL);
12561257
synchronize_rcu();
1257-
INIT_LIST_HEAD(&ar->arvifs);
1258+
1259+
spin_lock_bh(&ar->data_lock);
1260+
list_for_each_safe(pos, n, &ar->arvifs)
1261+
list_del_init(pos);
1262+
spin_unlock_bh(&ar->data_lock);
1263+
12581264
idr_init(&ar->txmgmt_idr);
12591265
}
12601266

0 commit comments

Comments
 (0)