Skip to content

Commit 079a108

Browse files
Wen Gongjmberg-intel
authored andcommitted
ath10k: drop MPDU which has discard flag set by firmware for SDIO
When the discard flag is set by the firmware for an MPDU, it should be dropped. This allows a mitigation for CVE-2020-24588 to be implemented in the firmware. Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049 Cc: [email protected] Signed-off-by: Wen Gong <[email protected]> Signed-off-by: Jouni Malinen <[email protected]> Link: https://lore.kernel.org/r/20210511200110.11968c725b5c.Idd166365ebea2771c0c0a38c78b5060750f90e17@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 40e7462 commit 079a108

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

drivers/net/wireless/ath/ath10k/htt_rx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,6 +2312,11 @@ static bool ath10k_htt_rx_proc_rx_ind_hl(struct ath10k_htt *htt,
23122312
fw_desc = &rx->fw_desc;
23132313
rx_desc_len = fw_desc->len;
23142314

2315+
if (fw_desc->u.bits.discard) {
2316+
ath10k_dbg(ar, ATH10K_DBG_HTT, "htt discard mpdu\n");
2317+
goto err;
2318+
}
2319+
23152320
/* I have not yet seen any case where num_mpdu_ranges > 1.
23162321
* qcacld does not seem handle that case either, so we introduce the
23172322
* same limitiation here as well.

drivers/net/wireless/ath/ath10k/rx_desc.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,19 @@ struct fw_rx_desc_base {
12821282
#define FW_RX_DESC_UDP (1 << 6)
12831283

12841284
struct fw_rx_desc_hl {
1285-
u8 info0;
1285+
union {
1286+
struct {
1287+
u8 discard:1,
1288+
forward:1,
1289+
any_err:1,
1290+
dup_err:1,
1291+
reserved:1,
1292+
inspect:1,
1293+
extension:2;
1294+
} bits;
1295+
u8 info0;
1296+
} u;
1297+
12861298
u8 version;
12871299
u8 len;
12881300
u8 flags;

0 commit comments

Comments
 (0)