Re: [PATCH v5 00/19] crypto: talitos - Driver cleanup
From: Herbert Xu
Date: Fri Sep 18 2026 - 05:44:10 EST
On Mon, Sep 07, 2026 at 03:22:34PM +0200, Paul Louvel wrote:
>
> A note on Sashiko third comment [1]:
>
> - If the current digest operation errors out because the driver
> returned -EAGAIN, it indeed clears the partial block buffer in the
> core with CRYPTO_AHASH_ALG_BLOCK_ONLY.
>
> Looking at how the API handles it, it means for me that the entire
> digest operation must be restarted, not just the current chunk of
> data currently being processed with .update() or .finup(). In this
> case, no need to keep the partial block buffer.
>
> If I am mistaken, how should this be handled?
How does it work currently?
Looking at the code briefly, it appears that it simply returns
EAGAIN to the Crypto API. There any error is treated as fatal
so the entire hash operation is aborted and any subsequent attempt
to update/finalise the hash results in a bogus hash value.
Of course memory associated with the request will still be freed
correctly.
AFAICS returning EAGAIN under the new interface is identical.
The partial buffer is cleared but that doesn't matter because
the entire hash state in the request buffer is now irrelevant.
If there is a memory corruption (not hash result corruption)
issue then that would be a real bug but I don't see it.
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt