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:	Wed, 1 Jun 2011 12:28:40 +0000
From:	KY Srinivasan <kys@...rosoft.com>
To:	Andre Bartke <andre.bartke@...glemail.com>,
	"gregkh@...e.de" <gregkh@...e.de>
CC:	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	Andre Bartke <andre.bartke@...il.com>,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] staging/hv: Fix memory leak of storvsc_dev_add()



> -----Original Message-----
> From: devel-bounces@...uxdriverproject.org [mailto:devel-
> bounces@...uxdriverproject.org] On Behalf Of Andre Bartke
> Sent: Tuesday, May 31, 2011 5:46 PM
> To: gregkh@...e.de
> Cc: devel@...verdev.osuosl.org; Andre Bartke; Haiyang Zhang; linux-
> kernel@...r.kernel.org
> Subject: [PATCH] staging/hv: Fix memory leak of storvsc_dev_add()
> 
> stor_device is not freed in storvsc_dev_add()
> causing a memory leak in case of an allocation error.
> 
> Signed-off-by: Andre Bartke <andre.bartke@...il.com>
> ---
>  drivers/staging/hv/storvsc.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
> index 06cd327..92b44f4 100644
> --- a/drivers/staging/hv/storvsc.c
> +++ b/drivers/staging/hv/storvsc.c
> @@ -414,6 +414,7 @@ int storvsc_dev_add(struct hv_device *device,
>  	device_info->target_id = stor_device->target_id;
> 
>  cleanup:
> +	free_stor_device(stor_device);
>  	return ret;

Was this patch tested? Even the normal path falls through the cleanup label
and obviously you should not be freeing the stor_device in that case. I have 
patches queued up to cleanup some of the unnecessary labels and meaningless
return values that I will be sending soon.

Regards,

K. Y
 


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