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

Commit b5bb13e1 authored by Terence Hampson's avatar Terence Hampson
Browse files

mdss: mdp3: Validate input from userspace



Fully verify that the values from client are safe to use.

Change-Id: I73d6839f5bccd53b8bc2d812dc7673b13735299c
Signed-off-by: default avatarTerence Hampson <thampson@codeaurora.org>
parent 66d0b021
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1218,7 +1218,8 @@ static int mdp3_ctrl_lut_update(struct msm_fb_data_type *mfd,
	if (!mdp3_session->dma->config_lut)
		return -EINVAL;

	if (cmap->start + cmap->len > MDP_LUT_SIZE) {
	if (cmap->start > MDP_LUT_SIZE || cmap->len > MDP_LUT_SIZE ||
			(cmap->start + cmap->len > MDP_LUT_SIZE)) {
		pr_err("mdp3_ctrl_lut_update invalid arguments\n");
		return  -EINVAL;
	}