ASoC: msm-lsm-client: Integer overflow check
Add integer overflow check for lsm_params_get_info size. Change-Id: I1130b5294f5de65eb8c595030c4db221337b1c8a Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
This commit is contained in:
parent
ba56a64009
commit
bbf1413556
@ -2653,6 +2653,15 @@ static int msm_lsm_ioctl(struct snd_pcm_substream *substream,
|
||||
err = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (temp_p_info.param_size > 0 &&
|
||||
((INT_MAX - sizeof(temp_p_info)) <
|
||||
temp_p_info.param_size)) {
|
||||
pr_err("%s: Integer overflow\n", __func__);
|
||||
err = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
size = sizeof(temp_p_info) + temp_p_info.param_size;
|
||||
p_info = kzalloc(size, GFP_KERNEL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user