302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From: Wen Gong <[email protected]>
  2. Date: Tue, 11 May 2021 20:02:54 +0200
  3. Subject: [PATCH] ath10k: drop fragments with multicast DA for SDIO
  4. Fragmentation is not used with multicast frames. Discard unexpected
  5. fragments with multicast DA. This fixes CVE-2020-26145.
  6. Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049
  7. Cc: [email protected]
  8. Signed-off-by: Wen Gong <[email protected]>
  9. Signed-off-by: Jouni Malinen <[email protected]>
  10. Signed-off-by: Johannes Berg <[email protected]>
  11. ---
  12. --- a/drivers/net/wireless/ath/ath10k/htt_rx.c
  13. +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
  14. @@ -2617,6 +2617,13 @@ static bool ath10k_htt_rx_proc_rx_frag_i
  15. rx_desc = (struct htt_hl_rx_desc *)(skb->data + tot_hdr_len);
  16. rx_desc_info = __le32_to_cpu(rx_desc->info);
  17. + hdr = (struct ieee80211_hdr *)((u8 *)rx_desc + rx_hl->fw_desc.len);
  18. +
  19. + if (is_multicast_ether_addr(hdr->addr1)) {
  20. + /* Discard the fragment with multicast DA */
  21. + goto err;
  22. + }
  23. +
  24. if (!MS(rx_desc_info, HTT_RX_DESC_HL_INFO_ENCRYPTED)) {
  25. spin_unlock_bh(&ar->data_lock);
  26. return ath10k_htt_rx_proc_rx_ind_hl(htt, &resp->rx_ind_hl, skb,
  27. @@ -2624,8 +2631,6 @@ static bool ath10k_htt_rx_proc_rx_frag_i
  28. HTT_RX_NON_TKIP_MIC);
  29. }
  30. - hdr = (struct ieee80211_hdr *)((u8 *)rx_desc + rx_hl->fw_desc.len);
  31. -
  32. if (ieee80211_has_retry(hdr->frame_control))
  33. goto err;