linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Eric Biggers <ebiggers@kernel.org>,
	davem@davemloft.net, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [BUG] crypto: export() overran state buffer on test vector
Date: Tue, 11 Feb 2020 20:21:18 +0100	[thread overview]
Message-ID: <20200211192118.GA24059@Red> (raw)
In-Reply-To: <20200208085713.ftuqxhatk6iioz7e@gondor.apana.org.au>

On Sat, Feb 08, 2020 at 04:57:13PM +0800, Herbert Xu wrote:
> On Fri, Feb 07, 2020 at 11:46:59AM +0100, Corentin Labbe wrote:
> >
> > My goal is to do like n2-crypto/rk3288crypto/etc..., fallback for init/update/final/finup and only do stuff with digest().
> > So I have just exactly copied what they do.
> 
> n2 at least is totally broken wrt import/export.  The other ones
> would work provided that the fallback have the same statesize as
> the generic sha implementations.
> 

This behavour happen only on arm64, so it is why probably nobody (rockchip/n2) found it.

> Are you not using the standard state sizes?

I use the standard size (statesize = sizeof(struct shaxxx_state))

As a quick workaround, By simply adding (+ 8), all test pass.

> 
> This should probably be switched over to lib/crypto or at least
> shash.
> 

Do you mean that I should abandon ahash as a fallback ?

  reply	other threads:[~2020-02-11 19:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06  8:54 [BUG] crypto: export() overran state buffer on test vector Corentin Labbe
2020-02-07  6:57 ` Eric Biggers
2020-02-07 10:46   ` Corentin Labbe
2020-02-08  8:57     ` Herbert Xu
2020-02-11 19:21       ` Corentin Labbe [this message]
2020-02-12  2:06         ` Herbert Xu
2020-02-12 18:57           ` Corentin Labbe
2020-02-13  5:05             ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200211192118.GA24059@Red \
    --to=clabbe.montjoie@gmail.com \
    --cc=davem@davemloft.net \
    --cc=ebiggers@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).