소스 검색

qcacmn: discard rx mgmt frame if decrypt error

If RX mgmt frame is received with error decryption,
discard it in WMI layer earlier to prevent further
processing and introducing unexpected behavior, do this
for MCL only.

Change-Id: I3d0f0ca72ae497012f93f39739b727692098ba2d
CRs-Fixed: 2296371
Jinwei Chen 6 년 전
부모
커밋
2e590ab62b
1개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 13 0
      wmi/src/wmi_unified_tlv.c

+ 13 - 0
wmi/src/wmi_unified_tlv.c

@@ -17891,6 +17891,13 @@ static QDF_STATUS extract_ext_tbttoffset_update_params_tlv(void *wmi_hdl,
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifdef CONFIG_MCL
+#define IS_WMI_RX_MGMT_FRAME_STATUS_INVALID(_status) \
+			((_status) & WMI_RXERR_DECRYPT)
+#else
+#define IS_WMI_RX_MGMT_FRAME_STATUS_INVALID(_status) false
+#endif
+
 /**
  * extract_mgmt_rx_params_tlv() - extract management rx params from event
  * @wmi_handle: wmi handle
@@ -17920,6 +17927,12 @@ static QDF_STATUS extract_mgmt_rx_params_tlv(wmi_unified_t wmi_handle,
 		return QDF_STATUS_E_INVAL;
 	}
 
+	if (IS_WMI_RX_MGMT_FRAME_STATUS_INVALID(ev_hdr->status)) {
+		WMI_LOGE("%s: RX mgmt frame decrypt error, discard it",
+			 __func__);
+		return QDF_STATUS_E_INVAL;
+	}
+
 	hdr->pdev_id = wmi_handle->ops->convert_pdev_id_target_to_host(
 							ev_hdr->pdev_id);