linux/drivers/net/wireless/realtek/rtlwifi/rtl8192ce
Jia-Ju Bai c7ba0ea0df rtlwifi: rtl8192ce: avoid accessing the data mapped to streaming DMA
In rtl92ce_tx_fill_cmddesc(), skb->data is mapped to streaming DMA on
line 530:
  dma_addr_t mapping = dma_map_single(..., skb->data, ...);

On line 533, skb->data is assigned to hdr after cast:
  struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);

Then hdr->frame_control is accessed on line 534:
  __le16 fc = hdr->frame_control;

This DMA access may cause data inconsistency between CPU and hardwre.

To fix this bug, hdr->frame_control is accessed before the DMA mapping.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201119015151.12110-1-baijiaju1990@gmail.com
2020-11-24 17:06:35 +02:00
..
def.h rtlwifi: rtl8188ee: rtl8192ce: rtl8192de: rtl8723ae: rtl8821ae: Remove some unused bit manipulation macros 2019-09-13 17:55:40 +03:00
dm.c rtlwifi: rtl8192ce: Rename RT_TRACE to rtl_dbg 2020-08-31 18:25:52 +03:00
dm.h
hw.c rtlwifi: rtl8192ce: fix comparison to bool warning in hw.c 2020-09-21 16:02:48 +03:00
hw.h
led.c rtlwifi: rtl8192ce: Rename RT_TRACE to rtl_dbg 2020-08-31 18:25:52 +03:00
led.h
Makefile
phy.c rtlwifi: rtl8192ce: Rename RT_TRACE to rtl_dbg 2020-08-31 18:25:52 +03:00
phy.h
reg.h
rf.c rtlwifi: rtl8192ce: Rename RT_TRACE to rtl_dbg 2020-08-31 18:25:52 +03:00
rf.h
sw.c rtlwifi: rtl8192ce: Make functions static & rm sw.h 2020-01-26 17:39:37 +02:00
table.c
table.h
trx.c rtlwifi: rtl8192ce: avoid accessing the data mapped to streaming DMA 2020-11-24 17:06:35 +02:00
trx.h rtlwifi: rtl8192ce: Fix incorrect returned values 2019-09-03 16:34:25 +03:00