All of lore.kernel.org
 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

* Re: [PATCH] crypto: sun8i-ss - fix infinite loop in sun8i_ss_setup_ivs()
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Corentin Labbe @ 2022-06-11  9:25 UTC (permalink / raw)
  To: Alexey Khoroshilov
  Cc: Herbert Xu, David S. Miller, linux-crypto, linux-sunxi,
	linux-kernel, ldv-project

Le Fri, Jun 10, 2022 at 09:27:15PM +0300, Alexey Khoroshilov a écrit :
> 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
> 

Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>

Thanks

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

* Re: [PATCH] crypto: sun8i-ss - fix infinite loop in sun8i_ss_setup_ivs()
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2022-06-17  9:25 UTC (permalink / raw)
  To: Alexey Khoroshilov
  Cc: Corentin Labbe, David S. Miller, linux-crypto, linux-sunxi,
	linux-kernel, ldv-project

On Fri, Jun 10, 2022 at 09:27:15PM +0300, Alexey Khoroshilov wrote:
> 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(+)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.