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

Commit 7dec44d5 authored by Robb Glasser's avatar Robb Glasser Committed by Dennis Cagle
Browse files

Prevent heap overflow in uvc driver



The size of uvc_control_mapping is user controlled leading to a
potential heap overflow in the uvc driver. This adds a check to verify
the user provided size fits within the bounds of the defined buffer
size.

Bug: 33300353
Change-Id: If29c1b396633b6137966a12e38f6fd1841b045bd
Signed-off-by: default avatarRobb Glasser <rglasser@google.com>
Git-repo: https://android.googlesource.com/kernel/msm


Git-commit: 8bc3ec72a02052187397d0de1a7b8bbe7340451c
Signed-off-by: default avatarDennis Cagle <dcagle@codeaurora.org>
parent cb57e6b4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1992,6 +1992,9 @@ int uvc_ctrl_add_mapping(struct uvc_video_chain *chain,
	if (!found)
		return -ENOENT;

	if (ctrl->info.size < mapping->size)
		return -EINVAL;

	if (mutex_lock_interruptible(&chain->ctrl_mutex))
		return -ERESTARTSYS;