summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelly Rossmoyer <krossmo@google.com>2019-05-09 17:44:51 -0700
committerKelly Rossmoyer <krossmo@google.com>2019-05-09 17:44:51 -0700
commit1394f772d9b80521d84a2c133f576780ab2f469a (patch)
tree7f06196dbdeaf5e7bbe0cb50a7c3f755e56c415a
parent467f55ca3b662cbac15c5bfbeb6308cfaa6d0c78 (diff)
parentfecaecf3b7dc2e5e35b67b40b799ce4948a98db0 (diff)
downloadqcacld-1394f772d9b80521d84a2c133f576780ab2f469a.tar.gz
Merge branch 'android-msm-bluecross-4.9-pi-dr1-security-next' into android-msm-bluecross-4.9-pi-dr1
JULY 2019.1 Bug: 131239907 Change-Id: I2ebaaa4724fad59e83bcb7b2e1b7473820e480f5 Signed-off-by: Kelly Rossmoyer <krossmo@google.com>
-rw-r--r--core/hdd/src/wlan_hdd_main.c7
-rw-r--r--core/mac/src/pe/lim/lim_process_disassoc_frame.c13
-rw-r--r--core/sme/src/rrm/sme_rrm.c8
3 files changed, 23 insertions, 5 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 9ccc966daa..8f5a9454fa 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -8306,6 +8306,8 @@ void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind)
hdd_adapter_t *adapter = NULL;
void *cds_context = NULL;
int i;
+ struct ieee80211_mgmt *mgmt =
+ (struct ieee80211_mgmt *)frame_ind->frameBuf;
/* Get the global VOSS context.*/
cds_context = cds_get_global_context();
@@ -8319,6 +8321,11 @@ void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind)
if (0 != wlan_hdd_validate_context(hdd_ctx))
return;
+ if (frame_ind->frame_len < ieee80211_hdrlen(mgmt->frame_control)) {
+ hdd_err(" Invalid frame length");
+ return;
+ }
+
if (SME_SESSION_ID_ANY == frame_ind->sessionId) {
for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) {
adapter =
diff --git a/core/mac/src/pe/lim/lim_process_disassoc_frame.c b/core/mac/src/pe/lim/lim_process_disassoc_frame.c
index c8ae79fc86..e36ecc939f 100644
--- a/core/mac/src/pe/lim/lim_process_disassoc_frame.c
+++ b/core/mac/src/pe/lim/lim_process_disassoc_frame.c
@@ -77,13 +77,12 @@ lim_process_disassoc_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo,
uint16_t aid, reasonCode;
tpSirMacMgmtHdr pHdr;
tpDphHashNode pStaDs;
-#ifdef WLAN_FEATURE_11W
- uint32_t frameLen;
-#endif
+ uint32_t frame_len;
int32_t frame_rssi;
pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo);
pBody = WMA_GET_RX_MPDU_DATA(pRxPacketInfo);
+ frame_len = WMA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
frame_rssi = (int32_t)WMA_GET_RX_RSSI_NORMALIZED(pRxPacketInfo);
@@ -137,11 +136,10 @@ lim_process_disassoc_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo,
/* If the frame received is unprotected, forward it to the supplicant to initiate */
/* an SA query */
- frameLen = WMA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
/* send the unprotected frame indication to SME */
lim_send_sme_unprotected_mgmt_frame_ind(pMac, pHdr->fc.subType,
(uint8_t *) pHdr,
- (frameLen +
+ (frame_len +
sizeof(tSirMacMgmtHdr)),
psessionEntry->smeSessionId,
psessionEntry);
@@ -149,6 +147,11 @@ lim_process_disassoc_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo,
}
#endif
+ if (frame_len < 2) {
+ pe_err("frame len less than 2");
+ return;
+ }
+
/* Get reasonCode from Disassociation frame body */
reasonCode = sir_read_u16(pBody);
diff --git a/core/sme/src/rrm/sme_rrm.c b/core/sme/src/rrm/sme_rrm.c
index 38b7560429..8e7cba1a4e 100644
--- a/core/sme/src/rrm/sme_rrm.c
+++ b/core/sme/src/rrm/sme_rrm.c
@@ -845,6 +845,14 @@ QDF_STATUS sme_rrm_process_beacon_report_req_ind(tpAniSirGlobal pMac,
sme_debug("Received Beacon report request ind Channel = %d",
pBeaconReq->channelInfo.channelNum);
+
+ if (pBeaconReq->channelList.numChannels >
+ SIR_ESE_MAX_MEAS_IE_REQS) {
+ sme_err("Beacon report request numChannels:%u exceeds max num channels",
+ pBeaconReq->channelList.numChannels);
+ return QDF_STATUS_E_INVAL;
+ }
+
/* section 11.10.8.1 (IEEE Std 802.11k-2008) */
/* channel 0 and 255 has special meaning. */
if ((pBeaconReq->channelInfo.channelNum == 0) ||