Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d54ded8c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdp: Validate input arguments from user space"

parents 34874d41 014fa8de
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -485,6 +485,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)) ||