mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 13:44:26 -04:00
qcacld-3.0: Fix buffer overflow in wma_pdev_hw_mode_transition_evt_handler
Make sure num_vdev_mac_entries which is coming from firmware within MAX_VDEV_SUPPORTED to avoid any buffer overflow or OOB read. Change-Id: I92793a6bcfd46b288c3f496a6f6cc9b372f60c48 CRs-Fixed: 2119432
This commit is contained in:
parent
47232fca8f
commit
34f720671a
1 changed files with 7 additions and 0 deletions
|
|
@ -3301,6 +3301,13 @@ static int wma_pdev_hw_mode_transition_evt_handler(void *handle,
|
|||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (param_buf->fixed_param->num_vdev_mac_entries > MAX_VDEV_SUPPORTED) {
|
||||
WMA_LOGE("num_vdev_mac_entries: %d crossed max value: %d",
|
||||
param_buf->fixed_param->num_vdev_mac_entries,
|
||||
MAX_VDEV_SUPPORTED);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
hw_mode_trans_ind = qdf_mem_malloc(sizeof(*hw_mode_trans_ind));
|
||||
if (!hw_mode_trans_ind) {
|
||||
WMA_LOGE("%s: Memory allocation failed", __func__);
|
||||
|
|
|
|||
Loading…
Reference in a new issue