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] [day] [month] [year] [list]
Message-ID: <7f8a2950-7145-438a-9118-2a71a0502fdd@default>
Date:	Thu, 10 Feb 2011 10:24:18 -0800 (PST)
From:	Dan Magenheimer <dan.magenheimer@...cle.com>
To:	Vasiliy Kulikov <segoon@...nwall.com>, linux-kernel@...r.kernel.org
Cc:	Greg Kroah-Hartman <gregkh@...e.de>,
	Nitin Gupta <ngupta@...are.org>, devel@...verdev.osuosl.org
Subject: RE: [PATCH] staging: zcache: fix memory leak

> From: Vasiliy Kulikov [mailto:segoon@...nwall.com]
> Sent: Thursday, February 10, 2011 11:01 AM
> 
> obj is not freed if __get_free_page() failed.
> 
> Signed-off-by: Vasiliy Kulikov <segoon@...nwall.com>

Thanks Vasiliy!  Good catch!

>  drivers/staging/zcache/zcache.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/zcache/zcache.c
> b/drivers/staging/zcache/zcache.c
> index 61be849..b8a2b30 100644
> --- a/drivers/staging/zcache/zcache.c
> +++ b/drivers/staging/zcache/zcache.c
> @@ -790,6 +790,7 @@ static int zcache_do_preload(struct tmem_pool
> *pool)
>  	page = (void *)__get_free_page(ZCACHE_GFP_MASK);
>  	if (unlikely(page == NULL)) {
>  		zcache_failed_get_free_pages++;
> +		kmem_cache_free(zcache_obj_cache, obj);
>  		goto unlock_out;
>  	}
>  	preempt_disable();

Acked-by: Dan Magenheimer <dan.magenheimer@...cle.com>
--
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