ath11k: Change DMA_FROM_DEVICE to DMA_TO_DEVICE when map reinjected packets
authorBaochen Qiang <bqiang@codeaurora.org>
Tue, 28 Sep 2021 11:00:46 +0000 (14:00 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 28 Sep 2021 14:05:34 +0000 (17:05 +0300)
commit86a03dad0f5ad8182ed5fcf7bf3eec71cd96577c
treee9f746d75eb3c292e5455e58e7b374f26cd6ae9c
parent6f4d70308e5eb63c99702e93f7c0d8e55f360da2
ath11k: Change DMA_FROM_DEVICE to DMA_TO_DEVICE when map reinjected packets

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: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210916064617.20006-1-bqiang@codeaurora.org
drivers/net/wireless/ath/ath11k/dp_rx.c