qcacld-2.0: Add sanity check for vdev_id in wma_wow_wakeup_host_event

Currently wake_info->vdev_id, recevied from the FW, is directly used
to refer to wma->interfaces without validating if the vdev_id is valid.

Add sanity check to make sure vdev_id is less than max_bssid before
using it.

Change-Id: I66be7d15f370d0204e25c3d0ea60c0c9f5912005
CRs-Fixed: 2114363
This commit is contained in:
Bala Venkatesh 2017-10-23 12:44:24 +05:30 committed by LuK1337
parent c622b1724d
commit 93a1694f9a

View file

@ -20202,6 +20202,11 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event,
if ((wake_info->wake_reason != WOW_REASON_UNSPECIFIED) ||
(wake_info->wake_reason == WOW_REASON_UNSPECIFIED &&
!wmi_get_runtime_pm_inprogress(wma->wmi_handle))) {
if (wake_info->vdev_id >= wma->max_bssid) {
WMA_LOGE("%s: received invalid vdev_id %d",
__func__, wake_info->vdev_id);
return -EINVAL;
}
WMA_LOGA("WOW wakeup host event received (reason: %s(%d)) for vdev %d",
wma_wow_wake_reason_str(wake_info->wake_reason, wma),
wake_info->wake_reason,