]> git.baikalelectronics.ru Git - kernel.git/commitdiff
crypto: sun8i-ss - fix infinite loop in sun8i_ss_setup_ivs()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 10 Jun 2022 18:27:15 +0000 (21:27 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 17 Jun 2022 09:19:20 +0000 (17:19 +0800)
There is no i decrement in while (i >= 0) loop.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: ac5d04edd6f3 ("crypto: sun8i-ss - rework handling of IV")
Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c

index 5bb950182026f03deb572ab8eda48dd025f5d1cb..910d6751644cf673ea218cb346d2cf6e7ba6ac8a 100644 (file)
@@ -170,6 +170,7 @@ dma_iv_error:
        while (i >= 0) {
                dma_unmap_single(ss->dev, rctx->p_iv[i], ivsize, DMA_TO_DEVICE);
                memzero_explicit(sf->iv[i], ivsize);
+               i--;
        }
        return err;
 }