lkml.org 
[lkml]   [2017]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [media] uvcvideo: Prevent heap overflow in uvc driver
On Mon, May 22, 2017 at 12:48:04PM -0700, Guenter Roeck wrote:
> From: Robb Glasser <rglasser@google.com>
>
> 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.
>
> Signed-off-by: Robb Glasser <rglasser@google.com>
> [groeck: cherry picked from
> https://source.codeaurora.org/quic/la/kernel/msm-3.10
> commit b7b99e55bc7770187913ed092990852ea52d7892;
> updated subject]
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> Fixes CVE-2017-0627.
>
Please do not apply this patch. It is buggy.

Guenter

> drivers/media/usb/uvc/uvc_ctrl.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
> index c2ee6e39fd0c..252ab991396f 100644
> --- a/drivers/media/usb/uvc/uvc_ctrl.c
> +++ b/drivers/media/usb/uvc/uvc_ctrl.c
> @@ -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;
>

\
 
 \ /
  Last update: 2017-06-28 16:38    [W:2.883 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site