linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: sun8i-ss - fix infinite loop in sun8i_ss_setup_ivs()
@ 2022-06-10 18:27 Alexey Khoroshilov
  2022-06-11  9:25 ` Corentin Labbe
  2022-06-17  9:25 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Khoroshilov @ 2022-06-10 18:27 UTC (permalink / raw)
  To: Corentin Labbe
  Cc: Alexey Khoroshilov, Herbert Xu, David S. Miller, linux-crypto,
	linux-sunxi, linux-kernel, ldv-project

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: 359e893e8af4 ("crypto: sun8i-ss - rework handling of IV")
---
 drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
index 5bb950182026..910d6751644c 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 @@ static int sun8i_ss_setup_ivs(struct skcipher_request *areq)
 	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;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-17  9:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-10 18:27 [PATCH] crypto: sun8i-ss - fix infinite loop in sun8i_ss_setup_ivs() Alexey Khoroshilov
2022-06-11  9:25 ` Corentin Labbe
2022-06-17  9:25 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).