Re: [BUG] crypto: tcrypt - data corruption in ahash tests with CRYPTO_AHASH_ALG_BLOCK_ONLY
From: T Pratham
Date: Fri Jan 16 2026 - 03:33:31 EST
On 16/01/26 08:00, Herbert Xu wrote:
> 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.
Yeah, I realized this a couple of hours after hitting the send button.
Only that partial block handling is the first place where I hit this.
>
> So we should fix tcrypt to not do this crazy thing.
Yup, looking forward for this.
>
> Thanks,
--
Regards
T Pratham <t-pratham@xxxxxx>