qcacld-3.0: Add check for if_id in wma_tbttoffset_update_event_handler

Currently if_id used in the for loop is incremented based on vdev_map != 0
and vdev_map is a uint_32, received from FW, and is right shifted by one bit
for each iteration. This could result in if_id going upto max of 31 and cause
OOB read.

Add sanity check to make sure if_id is less than max_bssid.

Change-Id: I7e0c4e9a26cb67f41e35c60c2756d7ad02cf43ea
CRs-Fixed: 2119443
这个提交包含在:
Vignesh Viswanathan
2017-10-04 20:09:09 +05:30
提交者 snandini
父节点 847dd5d509
当前提交 adb1b654b7

查看文件

@@ -2531,7 +2531,7 @@ int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
return -EINVAL;
}
for (; (vdev_map); vdev_map >>= 1, if_id++) {
for (; (if_id < wma->max_bssid && vdev_map); vdev_map >>= 1, if_id++) {
if (!(vdev_map & 0x1) || (!(intf[if_id].handle)))
continue;