All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uvcvideo: Fix crash when linking entities
@ 2011-09-06 22:29 Laurent Pinchart
  2011-09-07 15:32 ` Josh Boyer
  0 siblings, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2011-09-06 22:29 UTC (permalink / raw)
  To: linux-media
  Cc: JJosh Boyer, Dave Jones, Jonathan Nieder, Daniel Dickinson, 637740

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] uvcvideo: Fix crash when linking entities
  2011-09-06 22:29 [PATCH] uvcvideo: Fix crash when linking entities Laurent Pinchart
@ 2011-09-07 15:32 ` Josh Boyer
  2011-09-08  7:38   ` Laurent Pinchart
  0 siblings, 1 reply; 7+ messages in thread
From: Josh Boyer @ 2011-09-07 15:32 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-media, Dave Jones, Jonathan Nieder, Daniel Dickinson, 637740

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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] uvcvideo: Fix crash when linking entities
  2011-09-07 15:32 ` Josh Boyer
@ 2011-09-08  7:38   ` Laurent Pinchart
  2011-09-12  1:16     ` Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2011-09-08  7:38 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linux-media, Dave Jones, Jonathan Nieder, Daniel Dickinson

Hi Josh,

On Wednesday 07 September 2011 17:32:41 Josh Boyer wrote:
> 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.

Thank you. I will push the patch upstream.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] uvcvideo: Fix crash when linking entities
  2011-09-08  7:38   ` Laurent Pinchart
@ 2011-09-12  1:16     ` Jonathan Nieder
  2011-09-12 14:20       ` Laurent Pinchart
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Nieder @ 2011-09-12  1:16 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Josh Boyer, linux-media, Dave Jones,
	Daniel Dickinson

Hi Laurent and Mauro,

Laurent Pinchart wrote:
> On Wednesday 07 September 2011 17:32:41 Josh Boyer wrote:
>> On Wed, Sep 07, 2011 at 12:29:08AM +0200, Laurent Pinchart wrote:

>>>  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.
[...]
>> 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.
>
> Thank you. I will push the patch upstream.

Any news?  From Red Hat bugzilla, it seems that the fix was tested by
Marcin Zajaczkowski and user matanya.  More importantly, the patch
just makes sense.

I don't see this patch in Linus's master or

 git://linuxtv.org/media_tree.git staging/for_v3.2

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] uvcvideo: Fix crash when linking entities
  2011-09-12  1:16     ` Jonathan Nieder
@ 2011-09-12 14:20       ` Laurent Pinchart
  2011-09-12 17:22         ` Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2011-09-12 14:20 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Mauro Carvalho Chehab, Josh Boyer, linux-media, Dave Jones,
	Daniel Dickinson

Hi Jonathan,

On Monday 12 September 2011 03:16:14 Jonathan Nieder wrote:
> Laurent Pinchart wrote:
> > On Wednesday 07 September 2011 17:32:41 Josh Boyer wrote:
> >> On Wed, Sep 07, 2011 at 12:29:08AM +0200, Laurent Pinchart wrote:
> >>>  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.
> 
> [...]
> 
> >> 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.
> > 
> > Thank you. I will push the patch upstream.
> 
> Any news?  From Red Hat bugzilla, it seems that the fix was tested by
> Marcin Zajaczkowski and user matanya.  More importantly, the patch
> just makes sense.
> 
> I don't see this patch in Linus's master or
> 
>  git://linuxtv.org/media_tree.git staging/for_v3.2

I've just sent a pull request to Mauro.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] uvcvideo: Fix crash when linking entities
  2011-09-12 14:20       ` Laurent Pinchart
@ 2011-09-12 17:22         ` Jonathan Nieder
  2011-09-13  8:57           ` Laurent Pinchart
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Nieder @ 2011-09-12 17:22 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Josh Boyer, linux-media, Dave Jones,
	Daniel Dickinson

Laurent Pinchart wrote:

> I've just sent a pull request to Mauro.

Thanks!  Looks good to me, for what little that's worth.  My only nits
are that in the future it might be nice to "Cc: stable" and credit
testers so they can grep through commit logs to find out if the kernel
is fixed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] uvcvideo: Fix crash when linking entities
  2011-09-12 17:22         ` Jonathan Nieder
@ 2011-09-13  8:57           ` Laurent Pinchart
  0 siblings, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2011-09-13  8:57 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Mauro Carvalho Chehab, Josh Boyer, linux-media, Dave Jones,
	Daniel Dickinson

Hi Jonathan,

On Monday 12 September 2011 19:22:33 Jonathan Nieder wrote:
> Laurent Pinchart wrote:
> > I've just sent a pull request to Mauro.
> 
> Thanks!  Looks good to me, for what little that's worth.  My only nits
> are that in the future it might be nice to "Cc: stable" and credit
> testers so they can grep through commit logs to find out if the kernel
> is fixed.

I agree. Sorry for having forgotten about that.

Mauro, if it's not too late, can you add "Cc: stable@kernel.org" to this patch 
? Or should I send you a new pull request ?

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-09-13  8:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-06 22:29 [PATCH] uvcvideo: Fix crash when linking entities Laurent Pinchart
2011-09-07 15:32 ` Josh Boyer
2011-09-08  7:38   ` Laurent Pinchart
2011-09-12  1:16     ` Jonathan Nieder
2011-09-12 14:20       ` Laurent Pinchart
2011-09-12 17:22         ` Jonathan Nieder
2011-09-13  8:57           ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.