Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Kernel (http://www.linux-archive.org/debian-kernel/)
-   -   Bug#637740: uvcvideo: Fix crash when linking entities (http://www.linux-archive.org/debian-kernel/572614-bug-637740-uvcvideo-fix-crash-when-linking-entities.html)

Laurent Pinchart 09-06-2011 10:29 PM

Bug#637740: uvcvideo: Fix crash when linking entities
 
The uvc_mc_register_entity() function wrongfully selects the
media_entity associated with a UVC entity when creating links. This
results in access to uninitialized media_entity structures and can hit a
BUG_ON statement in media_entity_create_link(). Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/video/uvc/uvc_entity.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

This patch should fix a v3.0 regression that results in a kernel crash as
reported in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637740 and
https://bugzilla.redhat.com/show_bug.cgi?id=735437.

Test results will be welcome.

diff --git a/drivers/media/video/uvc/uvc_entity.c b/drivers/media/video/uvc/uvc_entity.c
index 48fea37..29e2399 100644
--- a/drivers/media/video/uvc/uvc_entity.c
+++ b/drivers/media/video/uvc/uvc_entity.c
@@ -49,7 +49,7 @@ static int uvc_mc_register_entity(struct uvc_video_chain *chain,
if (remote == NULL)
return -EINVAL;

- source = (UVC_ENTITY_TYPE(remote) != UVC_TT_STREAMING)
+ source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING)
? (remote->vdev ? &remote->vdev->entity : NULL)
: &remote->subdev.entity;
if (source == NULL)
--
Regards,

Laurent Pinchart




--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1315348148-7207-1-git-send-email-laurent.pinchart@ideasonboard.com">http://lists.debian.org/1315348148-7207-1-git-send-email-laurent.pinchart@ideasonboard.com

Josh Boyer 09-07-2011 03:32 PM

Bug#637740: uvcvideo: Fix crash when linking entities
 
On Wed, Sep 07, 2011 at 12:29:08AM +0200, Laurent Pinchart wrote:
> The uvc_mc_register_entity() function wrongfully selects the
> media_entity associated with a UVC entity when creating links. This
> results in access to uninitialized media_entity structures and can hit a
> BUG_ON statement in media_entity_create_link(). Fix it.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/video/uvc/uvc_entity.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> This patch should fix a v3.0 regression that results in a kernel crash as
> reported in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637740 and
> https://bugzilla.redhat.com/show_bug.cgi?id=735437.
>
> Test results will be welcome.

I built a test kernel for Fedora with the patch and the submitter of the
above bug has reported that the issue seems to be fixed.

josh

> diff --git a/drivers/media/video/uvc/uvc_entity.c b/drivers/media/video/uvc/uvc_entity.c
> index 48fea37..29e2399 100644
> --- a/drivers/media/video/uvc/uvc_entity.c
> +++ b/drivers/media/video/uvc/uvc_entity.c
> @@ -49,7 +49,7 @@ static int uvc_mc_register_entity(struct uvc_video_chain *chain,
> if (remote == NULL)
> return -EINVAL;
>
> - source = (UVC_ENTITY_TYPE(remote) != UVC_TT_STREAMING)
> + source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING)
> ? (remote->vdev ? &remote->vdev->entity : NULL)
> : &remote->subdev.entity;
> if (source == NULL)
> --
> Regards,
>
> Laurent Pinchart
>



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110907153240.GI10700@zod.bos.redhat.com">http://lists.debian.org/20110907153240.GI10700@zod.bos.redhat.com


All times are GMT. The time now is 07:04 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.