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: Wed, 12 Feb 2020 19:57:49 +0100 [thread overview]
Message-ID: <20200212185749.GA9886@Red> (raw)
In-Reply-To: <20200212020628.7grnopgwm6shn3hi@gondor.apana.org.au>
On Wed, Feb 12, 2020 at 10:06:28AM +0800, Herbert Xu wrote:
> On Tue, Feb 11, 2020 at 08:21:18PM +0100, Corentin Labbe wrote:
> >
> > Do you mean that I should abandon ahash as a fallback ?
>
> Perhaps switching to shash is not as straightforward because of
> SG handling. But if you're getting problems with statesize
> perhaps at least force a sync ahash algorithm might be a good
> idea.
>
I just found the problem, it happen with ARM CE which has a bigger state_size (sha256_ce_state) of 4bytes.
Since my driver didnt use statesize at all, I detect this on cra_init() like this:
if (algt->alg.hash.halg.statesize < crypto_ahash_statesize(op->fallback_tfm))
algt->alg.hash.halg.statesize = crypto_ahash_statesize(op->fallback_tfm);
Regards
next prev parent reply other threads:[~2020-02-12 18:57 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
2020-02-12 2:06 ` Herbert Xu
2020-02-12 18:57 ` Corentin Labbe [this message]
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=20200212185749.GA9886@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).