public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* potential null deref in mpeg_open()
@ 2009-07-19 11:47 Dan Carpenter
  2009-07-20 16:38 ` Steven Toth
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2009-07-19 11:47 UTC (permalink / raw)
  To: stoth; +Cc: mjpeg-users, linux-media

Hello,

I am testing a source checker (http://repo.or.cz/w/smatch.git) and it 
found a bug in in mpeg_open() from drivers/media/video/cx23885/cx23885-417.c

"dev" is null on line 1554, so on line 1558 dprintk() will cause a 
kernel oops if it is in debug mode.

drivers/media/video/cx23885/cx23885-417.c
  1554          struct cx23885_dev *h, *dev = NULL;
  1555          struct list_head *list;
  1556          struct cx23885_fh *fh;
  1557  
  1558          dprintk(2, "%s()\n", __func__);

Here is how dprintk() is defined earlier.

drivers/media/video/cx23885/cx23885-417.c
    59  #define dprintk(level, fmt, arg...)\
    60          do { if (v4l_debug >= level) \
    61                  printk(KERN_DEBUG "%s: " fmt, dev->name , ## arg);\
    62          } while (0)

regards,
dan carpenter

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

* Re: potential null deref in mpeg_open()
  2009-07-19 11:47 potential null deref in mpeg_open() Dan Carpenter
@ 2009-07-20 16:38 ` Steven Toth
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Toth @ 2009-07-20 16:38 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: mjpeg-users, linux-media

On 7/19/09 7:47 AM, Dan Carpenter wrote:
> Hello,
>
> I am testing a source checker (http://repo.or.cz/w/smatch.git) and it
> found a bug in in mpeg_open() from drivers/media/video/cx23885/cx23885-417.c
>
> "dev" is null on line 1554, so on line 1558 dprintk() will cause a
> kernel oops if it is in debug mode.
>
> drivers/media/video/cx23885/cx23885-417.c
>    1554          struct cx23885_dev *h, *dev = NULL;
>    1555          struct list_head *list;
>    1556          struct cx23885_fh *fh;
>    1557
>    1558          dprintk(2, "%s()\n", __func__);
>
> Here is how dprintk() is defined earlier.
>
> drivers/media/video/cx23885/cx23885-417.c
>      59  #define dprintk(level, fmt, arg...)\
>      60          do { if (v4l_debug>= level) \
>      61                  printk(KERN_DEBUG "%s: " fmt, dev->name , ## arg);\
>      62          } while (0)
>
> regards,
> dan carpenter

Thanks Dan,

I'd actually seen this three weeks ago when addressing another issue, although 
thanks for raising it. We're pushing a fix for this, and a few other fixes, 
later today.

-- 
Steven Toth - Kernel Labs
http://www.kernellabs.com

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

end of thread, other threads:[~2009-07-20 16:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19 11:47 potential null deref in mpeg_open() Dan Carpenter
2009-07-20 16:38 ` Steven Toth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox