lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 6 Jun 2008 11:07:11 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Matthew Garrett <mjg59@...f.ucam.org>
Cc:	Justin Mattock <justinmattock@...il.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-usb@...r.kernel.org
Subject: Re: [ 88.628451] BUG: unable to handle kernel paging request at
 f8dbf000 "isight_firmware"

On Fri, 6 Jun 2008 13:11:36 +0100 Matthew Garrett <mjg59@...f.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]);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ