[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200212185749.GA9886@Red>
Date: Wed, 12 Feb 2020 19:57:49 +0100
From: Corentin Labbe <clabbe.montjoie@...il.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Eric Biggers <ebiggers@...nel.org>, davem@...emloft.net,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [BUG] crypto: export() overran state buffer on test vector
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
Powered by blists - more mailing lists