From 95b9d463676d320e6904774b1a62ae9e2fbc615b Mon Sep 17 00:00:00 2001 From: Soumya Managoli Date: Mon, 31 Jul 2023 14:26:42 +0530 Subject: [PATCH] ASoC: msm-pcm-host-voice: Check validity of session idx Added check for voice session index. Mot-CRs-fixed: (CR) CVE-Fixed: CVE-2023-33110 CRs-Fixed: 3459076 Change-Id: Ifff36add5d62f2fdc3395de1447075d297f2c2df Signed-off-by: Soumya Managoli Signed-off-by: Ashutosh Verma Reviewed-on: https://gerrit.mot.com/2760359 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Hujun Liao Submit-Approved: Jira Key --- asoc/msm-pcm-host-voice-v2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/asoc/msm-pcm-host-voice-v2.c b/asoc/msm-pcm-host-voice-v2.c index 42c3a59a99ef..3ecec5eb7a0a 100644 --- a/asoc/msm-pcm-host-voice-v2.c +++ b/asoc/msm-pcm-host-voice-v2.c @@ -752,6 +752,13 @@ void hpcm_notify_evt_processing(uint8_t *data, char *session, return; } + if (prtd->mixer_conf.sess_indx < VOICE_INDEX || + prtd->mixer_conf.sess_indx >= MAX_SESSION) { + pr_err("%s:: Invalid session idx %d\n", + __func__, prtd->mixer_conf.sess_indx); + return; + } + if (notify_evt->tap_point == VSS_IVPCM_TAP_POINT_TX_DEFAULT) { tp = &prtd->session[prtd->mixer_conf.sess_indx].tx_tap_point; tmd = &prtd->mixer_conf.tx;