On Sat, Jun 14, 2025 at 08:18:07PM -0700, Eric Biggers wrote: > > Even with your patch applied, it overflows the stack when running the crypto > self-tests, apparently due to crypto/ahash.c calling into itself recursively: Thanks for the report. This driver doesn't provide a finup function which triggered a bug in the default finup implementation: ---8<--- Invoke the final function directly in the default finup implementation since crypto_ahash_final is now just a wrapper around finup. Reported-by: Eric Biggers <ebiggers@xxxxxxxxxx> Fixes: 9d7a0ab1c753 ("crypto: ahash - Handle partial blocks in API") Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> diff --git a/crypto/ahash.c b/crypto/ahash.c index bd9e49950201..3878b4da3cfd 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -603,12 +603,14 @@ static void ahash_def_finup_done2(void *data, int err) static int ahash_def_finup_finish1(struct ahash_request *req, int err) { + struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); + if (err) goto out; req->base.complete = ahash_def_finup_done2; - err = crypto_ahash_final(req); + err = crypto_ahash_alg(tfm)->final(req); if (err == -EINPROGRESS || err == -EBUSY) return err; -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt