mirror of
https://github.com/S3NEO/android_kernel_samsung_msm8226.git
synced 2024-11-07 03:47:13 +00:00
dsp: q6voice: Check size of shared memory buffer before access
Check buffer size in qdsp_cvs_callback before access in ul_pkt. Change-Id: Ic19994b46086709231656ec747d2df988b7a512f Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org> CVE-2019-10491 Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
This commit is contained in:
parent
b58874b551
commit
df890000c2
1 changed files with 5 additions and 0 deletions
|
@ -5843,6 +5843,11 @@ static int32_t qdsp_cvs_callback(struct apr_client_data *data, void *priv)
|
||||||
|
|
||||||
cvs_voc_pkt = v->shmem_info.sh_buf.buf[1].data;
|
cvs_voc_pkt = v->shmem_info.sh_buf.buf[1].data;
|
||||||
if (cvs_voc_pkt != NULL && common.mvs_info.ul_cb != NULL) {
|
if (cvs_voc_pkt != NULL && common.mvs_info.ul_cb != NULL) {
|
||||||
|
if (v->shmem_info.sh_buf.buf[1].size <
|
||||||
|
((3 * sizeof(uint32_t)) + cvs_voc_pkt[2])) {
|
||||||
|
pr_err("%s: invalid voc pkt size\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
/* cvs_voc_pkt[0] contains tx timestamp */
|
/* cvs_voc_pkt[0] contains tx timestamp */
|
||||||
common.mvs_info.ul_cb((uint8_t *)&cvs_voc_pkt[3],
|
common.mvs_info.ul_cb((uint8_t *)&cvs_voc_pkt[3],
|
||||||
cvs_voc_pkt[2],
|
cvs_voc_pkt[2],
|
||||||
|
|
Loading…
Reference in a new issue