Skip to contentSkip to conversation

ath11k: Add sanity check in htt pktlog

PATCH In review Anilkumar Kolli 2 participants 2 messages May 10, 2019 – May 13, 2019 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath11k: Add sanity check in htt pktlog

Add sanity check before processing pktlog buffer.

---
 drivers/net/wireless/ath/ath11k/debug.h | 2 ++
 drivers/net/wireless/ath/ath11k/dp_rx.c | 9 +++++++++
 2 files changed, 11 insertions(+)
drivers/net/wireless/ath/ath11k/debug.h +2 -0
index e51235f62536..13973d972169 100644
@@ -68,6 +68,8 @@ struct debug_htt_stats_req {
 
 #define ATH11K_FW_STATS_BUF_SIZE (1024 * 1024)
 
+#define ATH11K_HTT_PKTLOG_MAX_SIZE 2048
+
 enum ath11k_pktlog_filter {
 	ATH11K_PKTLOG_RX		= 0x000000001,
 	ATH11K_PKTLOG_TX		= 0x000000002,
drivers/net/wireless/ath/ath11k/dp_rx.c +9 -0
index 0796f3ba8333..c7582ce08899 100644
@@ -1072,6 +1072,15 @@ static void ath11k_htt_pktlog(struct ath11k_base *ab,
 	u8 pdev_id;
 
 	len = FIELD_GET(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M, *data);
+
+	if (len > ATH11K_HTT_PKTLOG_MAX_SIZE)
+	{
+		ath11k_warn(ab, "htt pktlog buffer size %d, expected < %d\n",
+			    len,
+			    ATH11K_HTT_PKTLOG_MAX_SIZE);
+		return;
+	}
+
 	pdev_id = FIELD_GET(HTT_T2H_PPDU_STATS_PDEV_ID_M, *data);
 	pdev_id = DP_HW2SW_MACID(pdev_id);
 	ar = ab->pdevs[pdev_id].ar;
Signature · 7 lines
1.9.1


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

Add sanity check before processing pktlog buffer.

Patch applied to ath.git, thanks.

65ab8594d0cf ath11k: Add sanity check in htt pktlog

Signature · 9 lines
https://patchwork.kernel.org/patch/10938543/

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


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k