mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Krufky <mkrufky@linuxtv.org>
To: stable@kernel.org, LKML <linux-kernel@vger.kernel.org>
Cc: Jarod Wilson <jarod@wilsonet.com>, LMML <linux-media@vger.kernel.org>
Subject: Fwd: [stable] [PATCH] 2.6.27.y: fix NULL ptr deref in cx23885  video_open
Date: Thu, 12 Mar 2009 16:24:38 -0400	[thread overview]
Message-ID: <37219a840903121324q7b08c8d1ma6d0d3ec4f5eb278@mail.gmail.com> (raw)
In-Reply-To: <200902241700.56099.jarod@redhat.com>

Can we have this merged into -stable?  Jarod Wilson sent this last
month, but he left off the cc to stable@kernel.org

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>


---------- Forwarded message ----------
From: Jarod Wilson <jarod@redhat.com>
Date: Tue, Feb 24, 2009 at 6:00 PM
Subject: [stable] [PATCH] 2.6.27.y: fix NULL ptr deref in cx23885 video_open
To: linux-kernel@vger.kernel.org
Cc: Mike Krufky <mkrufky@linuxtv.org>


From: Mark Jenks
https://www.redhat.com/mailman/private/video4linux-list/2009-January/msg00041.html

The Hauppauge WinTV HVR-1800 tv tuner card has both digital and analog
abilities, both of which are supported by v4l/dvb under 2.6.27.y. The analog
side also features a hardware mpeg2 encoder. The HVR-1250 tv tuner card
has both digital and analog abilities, but analog isn't currently supported
under any kernel. These cards both utilize the cx23885 driver, but with
slightly different usage. When the code paths for each card is executed,
they wind up poking a cx23885_devlist, which contains devices from both
of the cards, and access attempts are made to portions of 'struct
cx23885_dev' that aren't valid for that device. Simply add some extra
checks before trying to access these structs.

More gory details:
 http://article.gmane.org/gmane.linux.drivers.dvb/46630

This was triggering on my own system at home w/both cards in it, and
no longer happens with this patch included.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>

---

 drivers/media/video/cx23885/cx23885-417.c   |    2 +-
 drivers/media/video/cx23885/cx23885-video.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/cx23885/cx23885-417.c
b/drivers/media/video/cx23885/cx23885-417.c
index 7b0e8c0..19154b6 100644
--- a/drivers/media/video/cx23885/cx23885-417.c
+++ b/drivers/media/video/cx23885/cx23885-417.c
@@ -1585,7 +1585,7 @@ static int mpeg_open(struct inode *inode, struct
file *file)

       list_for_each(list, &cx23885_devlist) {
               h = list_entry(list, struct cx23885_dev, devlist);
-               if (h->v4l_device->minor == minor) {
+               if (h->v4l_device && h->v4l_device->minor == minor) {
                       dev = h;
                       break;
               }
diff --git a/drivers/media/video/cx23885/cx23885-video.c
b/drivers/media/video/cx23885/cx23885-video.c
index 6047c78..a2b5a0c 100644
--- a/drivers/media/video/cx23885/cx23885-video.c
+++ b/drivers/media/video/cx23885/cx23885-video.c
@@ -733,7 +733,7 @@ static int video_open(struct inode *inode, struct
file *file)

       list_for_each(list, &cx23885_devlist) {
               h = list_entry(list, struct cx23885_dev, devlist);
-               if (h->video_dev->minor == minor) {
+               if (h->video_dev && h->video_dev->minor == minor) {
                       dev  = h;
                       type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
               }


--
Jarod Wilson
jarod@redhat.com

  reply	other threads:[~2009-03-12 20:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24 22:00 Jarod Wilson
2009-03-12 20:24 ` Michael Krufky [this message]
2009-03-12 23:03   ` Fwd: " Andy Walls
2009-03-12 23:18     ` Michael Krufky
2009-03-12 23:49       ` Andy Walls
2009-03-13  2:50   ` [stable] Fwd: " Greg KH
2009-03-13  3:00     ` Jarod Wilson
2009-03-13  3:05       ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37219a840903121324q7b08c8d1ma6d0d3ec4f5eb278@mail.gmail.com \
    --to=mkrufky@linuxtv.org \
    --cc=jarod@wilsonet.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®