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, 24 Jul 2013 12:04:41 +0200
From:	Michal Hocko <mhocko@...e.cz>
To:	gregkh@...uxfoundation.org
Cc:	Piotr Sarna <p.sarna@...tner.samsung.com>, konrad.wilk@...cle.com,
	bob.liu@...cle.com, linux-kernel@...r.kernel.org,
	devel@...verdev.osuosl.org, b.zolnierkie@...sung.com,
	Kyungmin Park <kyungmin.park@...sung.com>
Subject: Re: [PATCH] zcache: fix "zcache=" kernel parameter

On Wed 24-07-13 12:02:35, Michal Hocko wrote:
> I have posted a similar fix quite some time ago and I guess Greg should
> already have it.

For reference https://lkml.org/lkml/2013/6/26/410
 
> Greg?
> 
> On Fri 19-07-13 16:46:41, Piotr Sarna wrote:
> > Commit 835f2f5 ("staging: zcache: enable zcache to be built/loaded as
> > a module") introduced an incorrect handling of "zcache=" parameter.
> > 
> > Inside zcache_comp_init() function, zcache_comp_name variable is
> > checked for being empty. If not empty, the above variable is tested
> > for being compatible with Crypto API. Unfortunately, after that
> > function ends unconditionally (by the "goto out" directive) and returns:
> > - non-zero value if verification succeeded, wrongly indicating an error
> > - zero value if verification failed, falsely informing that function
> >   zcache_comp_init() ended properly.
> > 
> > A solution to this problem is as following:
> > 1. Move the "goto out" directive inside the "if (!ret)" statement
> > 2. In case that crypto_has_comp() returned 0, change the value of ret
> >    to non-zero before "goto out" to indicate an error.
> > 
> > Signed-off-by: Piotr Sarna <p.sarna@...tner.samsung.com>
> > Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@...sung.com>
> > ---
> >  drivers/staging/zcache/zcache-main.c |    6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
> > index dcceed2..81972fa 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;
> > +			ret = 1;
> > +			goto out;
> > +		}
> >  	}
> >  	if (!ret)
> >  		strcpy(zcache_comp_name, "lzo");
> > -- 
> > 1.7.9.5
> > 
> > --
> > 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/
> 
> -- 
> Michal Hocko
> SUSE Labs
> --
> 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/

-- 
Michal Hocko
SUSE Labs
--
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