Re: [BUG] crypto: tcrypt - data corruption in ahash tests with CRYPTO_AHASH_ALG_BLOCK_ONLY
From: Herbert Xu
Date: Thu Jan 15 2026 - 21:30:20 EST
On Thu, Jan 15, 2026 at 03:38:50PM +0530, T Pratham wrote:
>
> However, in tcrypt, the wait struct is accessed as below:
>
> crypto/tcrypt.c:
> static inline int do_one_ahash_op(struct ahash_request *req, int ret)
> {
> struct crypto_wait *wait = req->base.data;
This is just broken. Even before the partial hash block handling
there are code paths where req->base.data will be modified prior
to final return. That's why the completion function takes a void *
instead of just passing the request back.
So we should fix tcrypt to not do this crazy thing.
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt