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]
Date:   Sun, 11 Feb 2018 22:37:30 +0800
From:   Geliang Tang <geliangtang@...il.com>
To:     Kees Cook <keescook@...omium.org>,
        Anton Vorontsov <anton@...msg.org>,
        Colin Cross <ccross@...roid.com>,
        Tony Luck <tony.luck@...el.com>
Cc:     Geliang Tang <geliangtang@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pstore: add lz4hc and 842 compression support 

On Tue, Nov 28, 2017 at 05:44:52PM -0800, Kees Cook wrote:
> > +
> > +       ret = LZ4_compress_default(in, out, inlen, outlen, workspace);
> > +       if (!ret) {
> > +               pr_err("LZ4_compress_default error; compression failed!\n");
> > +               return -EIO;
> > +       }
> > +
> > +       return ret;
> 
> Other compress/decompress return outlen, rather than ret. Is "ret" the
> outlen here?
> 

> > +
> > +       ret = LZ4_compress_HC(in, out, inlen, outlen,
> > +                             LZ4HC_DEFAULT_CLEVEL, workspace);
> > +       if (!ret) {
> > +               pr_err("LZ4_compress_HC error; compression failed!\n");
> > +               return -EIO;
> > +       }
> > +
> > +       return ret;
> 
> And here?
> 

Yes, ret is outlen in LZ4_compress_default and LZ4_compress_HC.

> > +
> > +       ret = sw842_compress(in, inlen, out, &len, workspace);
> > +       if (!ret) {
> > +               pr_err("sw842_compress error; compression failed!\n");
> > +               return -EIO;
> > +       }
> > +       outlen = len;
> 
> This has no effect. What was intended?
> 

> > +       ret = sw842_decompress(in, inlen, out, &len);
> > +       if (ret < 0) {
> > +               pr_err("sw842_decompress error, ret = %d!\n", ret);
> > +               return -EIO;
> > +       }
> > +       outlen = len;
> 
> Same.
> 

I fixed them in patch v3.

> 
> Otherwise this all looks good. Thanks!
> 
> -Kees
> 
> -- 
> Kees Cook
> Pixel Security

Geliang Tang (1):
  pstore: add lz4hc and 842 compression support

 fs/pstore/Kconfig    |  25 +++++++++
 fs/pstore/platform.c | 147 ++++++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 154 insertions(+), 18 deletions(-)

-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ