public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Justin Mattock <justinmattock@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-usb@vger.kernel.org
Subject: Re: [ 88.628451] BUG: unable to handle kernel paging request at f8dbf000 "isight_firmware"
Date: Fri, 6 Jun 2008 11:55:48 -0700	[thread overview]
Message-ID: <20080606185548.GB8576@kroah.com> (raw)
In-Reply-To: <dd18b0c30806061138h69c87d6am898a4eb409d379e1@mail.gmail.com>

On Fri, Jun 06, 2008 at 06:38:57PM +0000, Justin Mattock wrote:
> On Fri, Jun 6, 2008 at 6:10 PM, Justin Mattock <justinmattock@gmail.com> wrote:
> > On Fri, Jun 6, 2008 at 6:07 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
> >> On Fri, 6 Jun 2008 13:11:36 +0100 Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> >>
> >>> Argh. My firmware image contained the 0x8001 token that indicates end of
> >>> firmware - the ones generated by Etienne's tool don't, so the driver
> >>> reads straight off the end of the buffer. Can you try this patch? It
> >>> also incorporates the cleanups Andrew suggested, and should be resistant
> >>> to malformed data.
> >>>
> >>> diff --git a/drivers/usb/misc/isight_firmware.c b/drivers/usb/misc/isight_firmware.c
> >>> index 390e048..cc5943c 100644
> >>> --- a/drivers/usb/misc/isight_firmware.c
> >>> +++ b/drivers/usb/misc/isight_firmware.c
> >>> @@ -39,9 +39,9 @@ static int isight_firmware_load(struct usb_interface *intf,
> >>>       struct usb_device *dev = interface_to_usbdev(intf);
> >>>       int llen, len, req, ret = 0;
> >>>       const struct firmware *firmware;
> >>> -     unsigned char *buf;
> >>> +     unsigned char *buf = kmalloc(50, GFP_KERNEL);
> >>>       unsigned char data[4];
> >>> -     char *ptr;
> >>> +     u8 *ptr;
> >>
> >>        if (!buf)
> >>                return -ENOMEM;
> >>
> >> please.
> >>
> >>>       if (request_firmware(&firmware, "isight.fw", &dev->dev) != 0) {
> >>>               printk(KERN_ERR "Unable to load isight firmware\n");
> >>> @@ -59,7 +59,7 @@ static int isight_firmware_load(struct usb_interface *intf,
> >>>               goto out;
> >>>       }
> >>>
> >>> -     while (1) {
> >>> +     while (ptr+4 <= firmware->data+firmware->size) {
> >>>               memcpy(data, ptr, 4);
> >>>               len = (data[0] << 8 | data[1]);
> >>>               req = (data[2] << 8 | data[3]);
> >>
> >>
> >
> > O.K. Thanks for the help and patch, I'll go ahead and add that in and
> > let you know.
> > regards;
> >
> > --
> > Justin P. Mattock
> >
> 
> Alright applied the patch and everything seems O.K.,("now I can check
> shit in between my teeth") ;-)
> I let you know if something happens, and again thanks for the help.
> regards;

Great, thanks for testing and letting us know.

Matthew, care to send me a patch for the driver for 2.6.26-final?

thanks,

greg k-h

  reply	other threads:[~2008-06-06 19:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-04 19:13 [ 88.628451] BUG: unable to handle kernel paging request at f8dbf000 "isight_firmware" Justin Mattock
2008-06-06  7:26 ` Andrew Morton
2008-06-06  8:37   ` Justin Mattock
2008-06-06 12:11     ` Matthew Garrett
2008-06-06 14:24       ` Justin Mattock
2008-06-06 18:07       ` Andrew Morton
2008-06-06 18:10         ` Justin Mattock
2008-06-06 18:38           ` Justin Mattock
2008-06-06 18:55             ` Greg KH [this message]
2008-06-06 19:21               ` [PATCH] isight_firmware: Avoid crash on loading invalid firmware Matthew Garrett
2008-06-06 19:35                 ` Andrew Morton
2008-06-06 19:48                   ` Matthew Garrett
2008-06-06 21:14                     ` Justin Mattock
2008-06-06 21:50                       ` Matthew Garrett
2008-06-06 22:20                         ` Justin Mattock
2008-06-07  1:05                     ` Johannes Weiner
2008-06-07  2:38                       ` Justin Mattock

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=20080606185548.GB8576@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@linux-foundation.org \
    --cc=justinmattock@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mjg59@srcf.ucam.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