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

Commit 3005ca5d authored by Krishnankutty Kolathappilly's avatar Krishnankutty Kolathappilly Committed by Gerrit - the friendly Code Review server
Browse files

msm: cpp: Add error handling for invalid ioctl pointer



Invalid ioctl pointer part of compat ioctl can cause a crash. Add
error handling for invalid ioctl pointer.

Change-Id: I5afe46a5d89854388186fa16d979dd2f1f788a84
Signed-off-by: default avatarKrishnankutty Kolathappilly <kkolatha@codeaurora.org>
parent ecc254d7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3009,6 +3009,10 @@ static long msm_cpp_subdev_fops_compat_ioctl(struct file *file,
	kp_ioctl.trans_code = up32_ioctl.trans_code;
	/* Convert the 32 bit pointer to 64 bit pointer */
	kp_ioctl.ioctl_ptr = compat_ptr(up32_ioctl.ioctl_ptr);
	if (!kp_ioctl.ioctl_ptr) {
		pr_err("%s: Invalid ioctl pointer\n", __func__);
		return -EINVAL;
	}

	/*
	 * Convert 32 bit IOCTL ID's to 64 bit IOCTL ID's