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]
Message-ID: <20130626150116.GA6004@phenom.dumpdata.com>
Date:	Wed, 26 Jun 2013 11:01:16 -0400
From:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:	Michal Hocko <mhocko@...e.cz>, gregkh@...uxfoundation.org
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Bob Liu <lliubbo@...il.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	Cristian Rodríguez <crrodriguez@...nsuse.org>
Subject: Re: [PATCH] zcache: initialize module properly when zcache=FOO is
 given

On Wed, Jun 26, 2013 at 04:49:02PM +0200, Michal Hocko wrote:
> 835f2f51 (staging: zcache: enable zcache to be built/loaded as a module)
> introduced in 3.10-rc1 has introduced a bug for zcache=FOO module
> parameter processing.
> 
> zcache_comp_init return code doesn't agree with crypto_has_comp which
> uses 1 for the success unlike zcache_comp_init which uses 0. This
> causes module loading failure even if the given algorithm is supported:
> [    0.815330] zcache: compressor initialization failed
> 
> Reported-by: Cristian Rodríguez <crrodriguez@...nsuse.org>
> Signed-off-by: Michal Hocko <mhocko@...e.cz>

Looks OK to me.

Cc-ing Greg.

> ---
>  drivers/staging/zcache/zcache-main.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
> index dcceed2..0fe530b 100644
> --- a/drivers/staging/zcache/zcache-main.c
> +++ b/drivers/staging/zcache/zcache-main.c
> @@ -1811,10 +1811,12 @@ static int zcache_comp_init(void)
>  #else
>  	if (*zcache_comp_name != '\0') {
>  		ret = crypto_has_comp(zcache_comp_name, 0, 0);
> -		if (!ret)
> +		if (!ret) {
>  			pr_info("zcache: %s not supported\n",
>  					zcache_comp_name);
> -		goto out;
> +			goto out;
> +		}
> +		goto out_alloc;
>  	}
>  	if (!ret)
>  		strcpy(zcache_comp_name, "lzo");
> @@ -1827,6 +1829,7 @@ static int zcache_comp_init(void)
>  	pr_info("zcache: using %s compressor\n", zcache_comp_name);
>  
>  	/* alloc percpu transforms */
> +out_alloc:
>  	ret = 0;
>  	zcache_comp_pcpu_tfms = alloc_percpu(struct crypto_comp *);
>  	if (!zcache_comp_pcpu_tfms)
> -- 
> 1.8.3.1
> 
--
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