Skip to contentSkip to conversation

ath11k: fix rcu lock protect in peer assoc confirmation

PATCH In review Karthikeyan Periyasamy 2 participants 3 messages Feb 5, 2020 – Feb 11, 2020 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath11k: fix rcu lock protect in peer assoc confirmation

ath11k_mac_get_ar_by_vdev_id() get protected under rcu lock and unlock. peer association confirmation event get used this API without rcu protection, so corrected it.

---
 drivers/net/wireless/ath/ath11k/wmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/ath/ath11k/wmi.c +3 -0
index a9b301c..9cbe038d 100644
@@ -5345,15 +5345,18 @@ static void ath11k_peer_assoc_conf_event(struct ath11k_base *ab, struct sk_buff
 		   "peer assoc conf ev vdev id %d macaddr %pM\n",
 		   peer_assoc_conf.vdev_id, peer_assoc_conf.macaddr);
 
+	rcu_read_lock();
 	ar = ath11k_mac_get_ar_by_vdev_id(ab, peer_assoc_conf.vdev_id);
 
 	if (!ar) {
 		ath11k_warn(ab, "invalid vdev id in peer assoc conf ev %d",
 			    peer_assoc_conf.vdev_id);
+		rcu_read_unlock();
 		return;
 	}
 
 	complete(&ar->peer_assoc_done);
+	rcu_read_unlock();
 }
 
 static void ath11k_update_stats_event(struct ath11k_base *ab, struct sk_buff *skb)
Signature · 6 lines
1.9.1

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw
Quoted 6 lines · Karthikeyan Periyasamy

ath11k_mac_get_ar_by_vdev_id() get protected under rcu lock and unlock. peer association confirmation event get used this API without rcu protection, so corrected it.

Patch applied to ath-next branch of ath.git, thanks.

db0889aba262 ath11k: fix rcu lock protect in peer assoc confirmation

Signature · 8 lines
https://patchwork.kernel.org/patch/11365669/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#2 lore raw
In reply to Karthikeyan Periyasamy
Quoted 6 lines · Karthikeyan Periyasamy

ath11k_mac_get_ar_by_vdev_id() get protected under rcu lock and unlock. peer association confirmation event get used this API without rcu protection, so corrected it.

Patch applied to ath-next branch of ath.git, thanks.

db0889aba262 ath11k: fix rcu lock protect in peer assoc confirmation

Signature · 3 lines
https://patchwork.kernel.org/patch/11365669/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches