From: Alexey Khoroshilov Date: Fri, 10 Jun 2022 18:27:15 +0000 (+0300) Subject: crypto: sun8i-ss - fix infinite loop in sun8i_ss_setup_ivs() X-Git-Tag: v6.6.17~6939^2~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d61a7b3decf7f0cf4121a7204303deefd2c7151b;p=platform%2Fkernel%2Flinux-rpi.git crypto: sun8i-ss - fix infinite loop in sun8i_ss_setup_ivs() There is no i decrement in while (i >= 0) loop. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Alexey Khoroshilov Fixes: 359e893e8af4 ("crypto: sun8i-ss - rework handling of IV") Acked-by: Corentin Labbe Tested-by: Corentin Labbe Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c index 5bb9501..910d675 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c @@ -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; }