mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
wifi: ath12k: fix htt mlo-offset event locking
commit6afc57ea31
upstream. The ath12k active pdevs are protected by RCU but the htt mlo-offset event handling code calling ath12k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section. Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Compile tested only. Fixes:d889913205
("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Cc: stable@vger.kernel.org # v6.2 Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20231019113650.9060-3-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cf9c7d783a
commit
d908ca431e
@ -1658,11 +1658,12 @@ static void ath12k_htt_mlo_offset_event_handler(struct ath12k_base *ab,
|
|||||||
msg = (struct ath12k_htt_mlo_offset_msg *)skb->data;
|
msg = (struct ath12k_htt_mlo_offset_msg *)skb->data;
|
||||||
pdev_id = u32_get_bits(__le32_to_cpu(msg->info),
|
pdev_id = u32_get_bits(__le32_to_cpu(msg->info),
|
||||||
HTT_T2H_MLO_OFFSET_INFO_PDEV_ID);
|
HTT_T2H_MLO_OFFSET_INFO_PDEV_ID);
|
||||||
ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id);
|
|
||||||
|
|
||||||
|
rcu_read_lock();
|
||||||
|
ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id);
|
||||||
if (!ar) {
|
if (!ar) {
|
||||||
ath12k_warn(ab, "invalid pdev id %d on htt mlo offset\n", pdev_id);
|
ath12k_warn(ab, "invalid pdev id %d on htt mlo offset\n", pdev_id);
|
||||||
return;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_lock_bh(&ar->data_lock);
|
spin_lock_bh(&ar->data_lock);
|
||||||
@ -1678,6 +1679,8 @@ static void ath12k_htt_mlo_offset_event_handler(struct ath12k_base *ab,
|
|||||||
pdev->timestamp.mlo_comp_timer = __le32_to_cpu(msg->mlo_comp_timer);
|
pdev->timestamp.mlo_comp_timer = __le32_to_cpu(msg->mlo_comp_timer);
|
||||||
|
|
||||||
spin_unlock_bh(&ar->data_lock);
|
spin_unlock_bh(&ar->data_lock);
|
||||||
|
exit:
|
||||||
|
rcu_read_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ath12k_dp_htt_htc_t2h_msg_handler(struct ath12k_base *ab,
|
void ath12k_dp_htt_htc_t2h_msg_handler(struct ath12k_base *ab,
|
||||||
|
Loading…
Reference in New Issue
Block a user