From 2e590ab62bab679616be159715e4239bcb4b3067 Mon Sep 17 00:00:00 2001 From: Jinwei Chen Date: Mon, 20 Aug 2018 11:31:31 +0800 Subject: [PATCH] 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 --- wmi/src/wmi_unified_tlv.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 59c8324e6dbd..8472ee023056 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/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);