qcacmn: Add vdev id sanity check in extract_gtk_rsp_event_tlv
While handling WMI_GTK_OFFLOAD_STATUS_EVENTID, QDF_BUG() can occur in pmo_tgt_gtk_rsp_evt->pmo_psoc_get_vdev if vdev_id is out of range. As the value is directly from WLAN FW and can be outside the trust boundary. Add sanity check for vdev id once get parameter from wlan fw. Change-Id: I335df52fece39c1a51a556ba4678bd43f470673a CRs-Fixed: 2321523
This commit is contained in:
@@ -12540,6 +12540,12 @@ static QDF_STATUS extract_gtk_rsp_event_tlv(wmi_unified_t wmi_handle,
|
||||
|
||||
fixed_param = (WMI_GTK_OFFLOAD_STATUS_EVENT_fixed_param *)
|
||||
param_buf->fixed_param;
|
||||
|
||||
if (fixed_param->vdev_id >= WLAN_UMAC_PSOC_MAX_VDEVS) {
|
||||
wmi_err_rl("Invalid vdev_id %u", fixed_param->vdev_id);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
gtk_rsp_param->vdev_id = fixed_param->vdev_id;
|
||||
gtk_rsp_param->status_flag = QDF_STATUS_SUCCESS;
|
||||
gtk_rsp_param->refresh_cnt = fixed_param->refresh_cnt;
|
||||
|
Reference in New Issue
Block a user