Commit 65e9273c authored by Naseer Ahmed's avatar Naseer Ahmed

msm: mdp: Validate input arguments from user space

Fully verify the input arguments from user client are safe
to use.

Change-Id: Ie14332443b187951009c63ebfb78456dcd9ba60f
Signed-off-by: default avatarRaghavendra Ambadas <rambad@codeaurora.org>
Signed-off-by: default avatarNaseer Ahmed <naseer@codeaurora.org>
Bug: 19091590
parent 9d8f32ef
......@@ -551,6 +551,11 @@ static int mdp_lut_hw_update(struct fb_cmap *cmap)
c[1] = cmap->blue;
c[2] = cmap->red;
if (cmap->start > MDP_HIST_LUT_SIZE || cmap->len > MDP_HIST_LUT_SIZE ||
(cmap->start + cmap->len > MDP_HIST_LUT_SIZE)) {
pr_err("mdp_lut_hw_update invalid arguments\n");
return -EINVAL;
}
for (i = 0; i < cmap->len; i++) {
if (copy_from_user(&r, cmap->red++, sizeof(r)) ||
copy_from_user(&g, cmap->green++, sizeof(g)) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment