mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 22:23:14 -04:00
ASoC: msm-pcm-host-voice: Address buffer overflow in hpcm capture copy
There is no check for the copy data size of the ADSP returned payload. Add check for the max hpcm_buf_node size before copy to avoid buffer out of bounds issue. Change-Id: Id647888430ce302359a857ef54d321bee99889bf Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
This commit is contained in:
parent
fad96773ea
commit
7756692d54
1 changed files with 6 additions and 0 deletions
|
|
@ -683,6 +683,12 @@ static void hpcm_copy_capture_data_to_queue(struct dai_data *dai_data,
|
|||
if (dai_data->substream == NULL)
|
||||
return;
|
||||
|
||||
if (len >= HPCM_MAX_VOC_PKT_SIZE) {
|
||||
pr_err("%s: Copy capture data len %d is > HPCM_MAX_VOC_PKT_SIZE\n",
|
||||
__func__, len);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Copy out buffer packet into free_queue */
|
||||
spin_lock_irqsave(&dai_data->dsp_lock, dsp_flags);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue