Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762569AbYFFTFt (ORCPT ); Fri, 6 Jun 2008 15:05:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755332AbYFFTFh (ORCPT ); Fri, 6 Jun 2008 15:05:37 -0400 Received: from pentafluge.infradead.org ([213.146.154.40]:43167 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752773AbYFFTFg (ORCPT ); Fri, 6 Jun 2008 15:05:36 -0400 Date: Fri, 6 Jun 2008 11:55:48 -0700 From: Greg KH To: Justin Mattock Cc: Andrew Morton , Matthew Garrett , Linux Kernel Mailing List , linux-usb@vger.kernel.org Subject: Re: [ 88.628451] BUG: unable to handle kernel paging request at f8dbf000 "isight_firmware" Message-ID: <20080606185548.GB8576@kroah.com> References: <20080606002601.a0f6c47c.akpm@linux-foundation.org> <20080606121136.GA9087@srcf.ucam.org> <20080606110711.a9a6a4f6.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2607 Lines: 69 On Fri, Jun 06, 2008 at 06:38:57PM +0000, Justin Mattock wrote: > On Fri, Jun 6, 2008 at 6:10 PM, Justin Mattock wrote: > > On Fri, Jun 6, 2008 at 6:07 PM, Andrew Morton wrote: > >> On Fri, 6 Jun 2008 13:11:36 +0100 Matthew Garrett 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/