Skip to content

Commit df29f60

Browse files
committed
crypto: ahash - Fix infinite recursion in ahash_def_finup
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 <[email protected]> Fixes: 9d7a0ab ("crypto: ahash - Handle partial blocks in API") Signed-off-by: Herbert Xu <[email protected]>
1 parent ac90aad commit df29f60

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crypto/ahash.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,14 @@ static void ahash_def_finup_done2(void *data, int err)
600600

601601
static int ahash_def_finup_finish1(struct ahash_request *req, int err)
602602
{
603+
struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
604+
603605
if (err)
604606
goto out;
605607

606608
req->base.complete = ahash_def_finup_done2;
607609

608-
err = crypto_ahash_final(req);
610+
err = crypto_ahash_alg(tfm)->final(req);
609611
if (err == -EINPROGRESS || err == -EBUSY)
610612
return err;
611613

0 commit comments

Comments
 (0)