mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
qcacld-3.0: Possible buffer overflow in wma_stats_ext_event_handler
Check for stats ext info data len does not take TLV header size into account which could lead to buffer overflow when copying data where TLV header size is taken into account. Fix is to subtract TLV header size and stats_ext_info size from max allowed size when validating stats ext info data length. Change-Id: I34e35a0aab396af3d93a0f61e0ab6a2da09f22ab CRs-Fixed: 2227263
This commit is contained in:
parent
33942c4344
commit
f71b48e505
1 changed files with 2 additions and 2 deletions
|
|
@ -452,8 +452,8 @@ int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
|
|||
alloc_len += stats_ext_info->data_len;
|
||||
|
||||
if (stats_ext_info->data_len > (WMI_SVC_MSG_MAX_SIZE -
|
||||
sizeof(*stats_ext_info)) || stats_ext_info->data_len >
|
||||
param_buf->num_data) {
|
||||
WMI_TLV_HDR_SIZE - sizeof(*stats_ext_info)) ||
|
||||
stats_ext_info->data_len > param_buf->num_data) {
|
||||
WMA_LOGE("Excess data_len:%d, num_data:%d",
|
||||
stats_ext_info->data_len, param_buf->num_data);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue