Skip to content
Snippets Groups Projects
Commit 89e0fbac authored by Suman Mukherjee's avatar Suman Mukherjee Committed by Patrick Tjin
Browse files

msm: camera: add check for csid_cid to prevent of overwrite memory


add sanity check for csid cid to ensute that we never read or write
outside csid_dev->mem buffer

Bug: 19134929
Change-Id: Ic8f0d689fa176720ae3a3316f2ad27556ae7bde5
Signed-off-by: default avatarSuman Mukherjee <sumam@codeaurora.org>
Signed-off-by: default avatarPatrick Tjin <pattjin@google.com>
parent f3ff9ea4
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,13 @@ static int msm_csid_cid_lut(
return -EINVAL;
}
for (i = 0; i < csid_lut_params->num_cid && i < 16; i++) {
if (csid_lut_params->vc_cfg[i]->cid >=
csid_lut_params->num_cid ||
csid_lut_params->vc_cfg[i]->cid < 0) {
pr_err("%s: cid outside range %d\n",
__func__, csid_lut_params->vc_cfg[i]->cid);
return -EINVAL;
}
CDBG("%s lut params num_cid = %d, cid = %d, dt = %x, df = %d\n",
__func__,
csid_lut_params->num_cid,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment