1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
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 rtlwifi: rtl8192{c,u}: Remove CamelCase variables 2019-02-19 17:02:56 +02:00
hw.c rtlwifi: rtl8192ce: fix comparison to bool warning in hw.c 2020-09-21 16:02:48 +03:00
hw.h rtlwifi: rtl8192ce: Replace old-style license information 2019-02-19 16:59:57 +02:00
led.c rtlwifi: rtl8192ce: Rename RT_TRACE to rtl_dbg 2020-08-31 18:25:52 +03:00
led.h rtlwifi: rtl8192ce: Replace old-style license information 2019-02-19 16:59:57 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
phy.c rtlwifi: rtl8192ce: Rename RT_TRACE to rtl_dbg 2020-08-31 18:25:52 +03:00
phy.h rtlwifi: rtl8192{c,u}: Remove CamelCase variables 2019-02-19 17:02:56 +02:00
reg.h rtlwifi: rtl8192{c,u}: Remove CamelCase variables 2019-02-19 17:02:56 +02:00
rf.c rtlwifi: rtl8192ce: Rename RT_TRACE to rtl_dbg 2020-08-31 18:25:52 +03:00
rf.h rtlwifi: rtl8192ce: Replace old-style license information 2019-02-19 16:59:57 +02:00
sw.c rtlwifi: rtl8192ce: Make functions static & rm sw.h 2020-01-26 17:39:37 +02:00
table.c rtlwifi: rtl8192ce: Fix missing blank lines 2019-02-28 10:30:03 +02:00
table.h rtlwifi: rtl8192ce: Replace old-style license information 2019-02-19 16:59:57 +02:00
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