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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091230171457.GA15063@localhost>
Date:	Wed, 30 Dec 2009 18:14:58 +0100
From:	Johan Hovold <jhovold@...il.com>
To:	Dan Carpenter <error27@...il.com>
Cc:	Greg Kroah-Hartman <gregkh@...e.de>, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org, Johan Hovold <jhovold@...il.com>
Subject: Re: [patch] USB: serial: fix DMA buffers on stack for io_edgeport.c

Hey Dan,

Looks like you forgot to free StringDesc:

> --- orig/drivers/usb/serial/io_edgeport.c	2009-12-30 16:20:35.000000000 +0200
> +++ devel/drivers/usb/serial/io_edgeport.c	2009-12-30 16:25:27.000000000 +0200
> @@ -372,21 +372,24 @@ static void update_edgeport_E2PROM(struc
>   ************************************************************************/
>  static int get_string(struct usb_device *dev, int Id, char *string, int buflen)
>  {
> -	struct usb_string_descriptor StringDesc;
> +	struct usb_string_descriptor *StringDesc;
>  	struct usb_string_descriptor *pStringDesc;
>  
>  	dbg("%s - USB String ID = %d", __func__, Id);
>  
> +	StringDesc = kmalloc(sizeof(*StringDesc), GFP_KERNEL);
> +	if (!StringDesc)
> +		return 0;
>  	if (!usb_get_descriptor(dev, USB_DT_STRING, Id,
> -					&StringDesc, sizeof(StringDesc)))
> +					StringDesc, sizeof(*StringDesc)))

here

>  		return 0;
>  
> -	pStringDesc = kmalloc(StringDesc.bLength, GFP_KERNEL);
> +	pStringDesc = kmalloc(StringDesc->bLength, GFP_KERNEL);
>  	if (!pStringDesc)

here

>  		return 0;
>  
>  	if (!usb_get_descriptor(dev, USB_DT_STRING, Id,
> -					pStringDesc, StringDesc.bLength)) {
> +					pStringDesc, StringDesc->bLength)) {

here

>  		kfree(pStringDesc);
>  		return 0;
>  	}

and here.

Thanks,
Johan

--
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