瀏覽代碼

qcacmn: Check the MPDU start tag before read ppdu id

Check the MPDU start tag before read ppdu id in MPDU
start TLV in the head of packet TLV.

Change-Id: I0b9a367e148d55a6c667adc8ad16e7c0fdf0a741
Kai Chen 6 年之前
父節點
當前提交
339b01d8ae
共有 2 個文件被更改,包括 27 次插入0 次删除
  1. 8 0
      dp/wifi3.0/dp_rx_mon_dest.c
  2. 19 0
      hal/wifi3.0/hal_api_mon.h

+ 8 - 0
dp/wifi3.0/dp_rx_mon_dest.c

@@ -222,6 +222,14 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id,
 				 num_msdus);
 
 			if (is_first_msdu) {
+				if (!HAL_RX_HW_DESC_MPDU_VALID(
+					rx_desc_tlv)) {
+					drop_mpdu = true;
+					qdf_nbuf_free(msdu);
+					msdu = NULL;
+					goto next_msdu;
+				}
+
 				msdu_ppdu_id = HAL_RX_HW_DESC_GET_PPDUID_GET(
 						rx_desc_tlv);
 				is_first_msdu = false;

+ 19 - 0
hal/wifi3.0/hal_api_mon.h

@@ -212,6 +212,25 @@ HAL_RX_DESC_GET_80211_HDR(void *hw_desc_addr) {
 	return rx_pkt_hdr;
 }
 
+/*
+ * HAL_RX_HW_DESC_MPDU_VALID() - check MPDU start TLV tag in MPDU
+ *			start TLV of Hardware TLV descriptor
+ * @hw_desc_addr: Hardware desciptor address
+ *
+ * Return: bool: if TLV tag match
+ */
+static inline
+bool HAL_RX_HW_DESC_MPDU_VALID(void *hw_desc_addr)
+{
+	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)hw_desc_addr;
+	uint32_t tlv_tag;
+
+	tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(
+		&rx_desc->mpdu_start_tlv);
+
+	return tlv_tag == WIFIRX_MPDU_START_E ? true : false;
+}
+
 static inline
 uint32_t HAL_RX_HW_DESC_GET_PPDUID_GET(void *hw_desc_addr)
 {