Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Commit

Permalink
qcacld-3.0: Fix OOB read in sme_rrm_process_beacon_report_req_ind
Browse files Browse the repository at this point in the history
When beacon report request action frame is received,
rrm_process_beacon_report_req() is called and num_channels value
is calculated from the action frame directly from user. This
value is assigned to pSmeBcnReportReq->channelList.numChannels
and this num channels value along with the channel list is
posted to sme for further processing. The sme function
sme_rrm_process_beacon_report_req_ind() processes this sme
message eWNI_SME_BEACON_REPORT_REQ_IND. In this function,
the channels in channel list are looped through the received
value pBeaconReq->channelList.numChannels and is copied to the
destination pSmeRrmContext->channelList array from the
pBeaconReq->channelList.channelNumber[] array.
The maximum possible number of channels in channel list
BeaconReq->channelList.channelNumber[] allocated statically
in the definition of tSirChannelList is
SIR_ESE_MAX_MEAS_IE_REQS (8).
So when the pBeaconReq->channelList.numChannels, possible OOB
read occurs.

Validate the value of pBeaconReq->channelList.numChannels
received from the action frame against the maximum supported
number of channels in channel list SIR_ESE_MAX_MEAS_IE_REQS (8).
Place this validation inside the function
sme_rrm_process_beacon_report_req_ind() instead of validating it
at rrm_process_beacon_report_req() so that it defends from other
caller sme_set_ese_beacon_request() which is from user space
command through IOCTL.

Change-Id: I2074b04081328ceab7eeb29c33631a635e9d93c3
CRs-Fixed: 2335974
Bug: 125677804
Signed-off-by: Srinivas Girigowda <quic_sgirigow@quicinc.com>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
  • Loading branch information
Pragaspathi Thilagaraj authored and 0ctobot committed Apr 6, 2019
1 parent 4f95277 commit fc3ded1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/staging/qcacld-3.0/core/sme/src/rrm/sme_rrm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down

0 comments on commit fc3ded1

Please sign in to comment.