mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 02:21:16 +00:00
Merge "drivers: soc: qcom: Add overflow check for sound model size"
This commit is contained in:
commit
0a59214a62
1 changed files with 7 additions and 0 deletions
|
@ -1913,6 +1913,13 @@ static int msm_cpe_lsm_reg_model(struct snd_pcm_substream *substream,
|
|||
|
||||
lsm_ops->lsm_get_snd_model_offset(cpe->core_handle,
|
||||
session, &offset);
|
||||
/* Check if 'p_info->param_size + offset' crosses U32_MAX. */
|
||||
if (p_info->param_size > U32_MAX - offset) {
|
||||
dev_err(rtd->dev,
|
||||
"%s: Invalid param_size %d\n",
|
||||
__func__, p_info->param_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
session->snd_model_size = p_info->param_size + offset;
|
||||
|
||||
session->snd_model_data = vzalloc(session->snd_model_size);
|
||||
|
|
Loading…
Reference in a new issue