All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] ath11k: Change DMA_FROM_DEVICE to DMA_TO_DEVICE when map reinjected packets
@ 2021-09-13 18:02 ` Jouni Malinen
  0 siblings, 0 replies; 20+ messages in thread
From: Jouni Malinen @ 2021-09-13 18:02 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath11k, linux-wireless, Baochen Qiang, Jouni Malinen

From: Baochen Qiang <bqiang@codeaurora.org>

For fragmented packets, ath11k reassembles each fragment as a normal
packet and then reinjects it into HW ring. In this case, the DMA
direction should be DMA_TO_DEVICE, not DMA_FROM_DEVICE, otherwise
invalid payload will be reinjected to HW and then delivered to host.
What is more, since arbitrary memory could be allocated to the frame, we
don't know what kind of data is contained in the buffer reinjected.
Thus, as a bad result, private info may be leaked.

Note that this issue is only found on Intel platform.

Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Signed-off-by: Baochen Qiang <bqiang@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index 90da56316e7e..0c27eead3e02 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -3434,7 +3434,7 @@ static int ath11k_dp_rx_h_defrag_reo_reinject(struct ath11k *ar, struct dp_rx_ti
 
 	paddr = dma_map_single(ab->dev, defrag_skb->data,
 			       defrag_skb->len + skb_tailroom(defrag_skb),
-			       DMA_FROM_DEVICE);
+			       DMA_TO_DEVICE);
 	if (dma_mapping_error(ab->dev, paddr))
 		return -ENOMEM;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-10-11 15:12 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 18:02 [PATCH 1/5] ath11k: Change DMA_FROM_DEVICE to DMA_TO_DEVICE when map reinjected packets Jouni Malinen
2021-09-13 18:02 ` Jouni Malinen
2021-09-13 18:02 ` [PATCH 2/5] ath11k: Drop MSDU with length error in DP rx path Jouni Malinen
2021-09-13 18:02   ` Jouni Malinen
2021-09-28 13:34   ` Kalle Valo
2021-09-28 13:34   ` Kalle Valo
2021-09-13 18:02 ` [PATCH 3/5] ath11k: Fix inaccessible debug registers Jouni Malinen
2021-09-13 18:02   ` Jouni Malinen
2021-09-13 18:02 ` [PATCH 4/5] ath11k: Fix memory leak in ath11k_qmi_driver_event_work Jouni Malinen
2021-09-13 18:02   ` Jouni Malinen
2021-09-13 18:02 ` [PATCH 5/5] ath11k: Handle MSI enablement during rmmod and SSR Jouni Malinen
2021-09-13 18:02   ` Jouni Malinen
2021-10-11  6:47   ` Kalle Valo
2021-10-11  6:47     ` Kalle Valo
2021-10-11 15:11   ` Kalle Valo
2021-10-11 15:11     ` Kalle Valo
2021-09-13 22:38 ` [PATCH 1/5] ath11k: Change DMA_FROM_DEVICE to DMA_TO_DEVICE when map reinjected packets Peter Oh
2021-09-13 22:38   ` Peter Oh
2021-09-14 17:09 ` Kalle Valo
2021-09-14 17:09 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.