linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: sun8i-ss - remove redundant memzero_explicit()
@ 2020-08-27  7:40 Denis Efremov
  2020-08-27  8:03 ` Corentin Labbe
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Efremov @ 2020-08-27  7:40 UTC (permalink / raw)
  To: Corentin Labbe; +Cc: Denis Efremov, Herbert Xu, linux-crypto, linux-kernel

Remove redundant memzero_explicit() in sun8i_ss_cipher() before calling
kfree_sensitive(). kfree_sensitive() will zero the memory with
memzero_explicit().

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
index deb8b39a86db..ed2a69f82e1c 100644
--- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
+++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
@@ -248,7 +248,6 @@ static int sun8i_ss_cipher(struct skcipher_request *areq)
 			offset = areq->cryptlen - ivsize;
 			if (rctx->op_dir & SS_DECRYPTION) {
 				memcpy(areq->iv, backup_iv, ivsize);
-				memzero_explicit(backup_iv, ivsize);
 				kfree_sensitive(backup_iv);
 			} else {
 				scatterwalk_map_and_copy(areq->iv, areq->dst, offset,
-- 
2.26.2


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

* Re: [PATCH] crypto: sun8i-ss - remove redundant memzero_explicit()
  2020-08-27  7:40 [PATCH] crypto: sun8i-ss - remove redundant memzero_explicit() Denis Efremov
@ 2020-08-27  8:03 ` Corentin Labbe
  2020-08-27 12:12   ` Denis Efremov
  2020-08-27 12:16   ` [PATCH v2] " Denis Efremov
  0 siblings, 2 replies; 5+ messages in thread
From: Corentin Labbe @ 2020-08-27  8:03 UTC (permalink / raw)
  To: Denis Efremov; +Cc: Herbert Xu, linux-crypto, linux-kernel

On Thu, Aug 27, 2020 at 10:40:23AM +0300, Denis Efremov wrote:
> Remove redundant memzero_explicit() in sun8i_ss_cipher() before calling
> kfree_sensitive(). kfree_sensitive() will zero the memory with
> memzero_explicit().
> 
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>  drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
> index deb8b39a86db..ed2a69f82e1c 100644
> --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
> +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
> @@ -248,7 +248,6 @@ static int sun8i_ss_cipher(struct skcipher_request *areq)
>  			offset = areq->cryptlen - ivsize;
>  			if (rctx->op_dir & SS_DECRYPTION) {
>  				memcpy(areq->iv, backup_iv, ivsize);
> -				memzero_explicit(backup_iv, ivsize);
>  				kfree_sensitive(backup_iv);
>  			} else {
>  				scatterwalk_map_and_copy(areq->iv, areq->dst, offset,
> -- 
> 2.26.2
> 

Hello

Could you add:
Fixes: 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()")

Regards

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

* Re: [PATCH] crypto: sun8i-ss - remove redundant memzero_explicit()
  2020-08-27  8:03 ` Corentin Labbe
@ 2020-08-27 12:12   ` Denis Efremov
  2020-08-27 12:16   ` [PATCH v2] " Denis Efremov
  1 sibling, 0 replies; 5+ messages in thread
From: Denis Efremov @ 2020-08-27 12:12 UTC (permalink / raw)
  To: Corentin Labbe; +Cc: Herbert Xu, linux-crypto, linux-kernel



On 8/27/20 11:03 AM, Corentin Labbe wrote:
> Could you add:
> Fixes: 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()")

I doubt this change deserves fixes tag, since this is just a cleanup.
Anyway, I will send v2 with it.

Thanks,
Denis

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

* [PATCH v2] crypto: sun8i-ss - remove redundant memzero_explicit()
  2020-08-27  8:03 ` Corentin Labbe
  2020-08-27 12:12   ` Denis Efremov
@ 2020-08-27 12:16   ` Denis Efremov
  2020-09-04  8:28     ` Herbert Xu
  1 sibling, 1 reply; 5+ messages in thread
From: Denis Efremov @ 2020-08-27 12:16 UTC (permalink / raw)
  To: Corentin Labbe; +Cc: Denis Efremov, Herbert Xu, linux-crypto, linux-kernel

Remove redundant memzero_explicit() in sun8i_ss_cipher() before calling
kfree_sensitive(). kfree_sensitive() will zero the memory with
memzero_explicit().

Fixes: 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()")
Signed-off-by: Denis Efremov <efremov@linux.com>
---
Changes in v2:
 - fixes tag added

 drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
index deb8b39a86db..ed2a69f82e1c 100644
--- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
+++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
@@ -248,7 +248,6 @@ static int sun8i_ss_cipher(struct skcipher_request *areq)
 			offset = areq->cryptlen - ivsize;
 			if (rctx->op_dir & SS_DECRYPTION) {
 				memcpy(areq->iv, backup_iv, ivsize);
-				memzero_explicit(backup_iv, ivsize);
 				kfree_sensitive(backup_iv);
 			} else {
 				scatterwalk_map_and_copy(areq->iv, areq->dst, offset,
-- 
2.26.2


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

* Re: [PATCH v2] crypto: sun8i-ss - remove redundant memzero_explicit()
  2020-08-27 12:16   ` [PATCH v2] " Denis Efremov
@ 2020-09-04  8:28     ` Herbert Xu
  0 siblings, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2020-09-04  8:28 UTC (permalink / raw)
  To: Denis Efremov; +Cc: Corentin Labbe, linux-crypto, linux-kernel

On Thu, Aug 27, 2020 at 03:16:11PM +0300, Denis Efremov wrote:
> Remove redundant memzero_explicit() in sun8i_ss_cipher() before calling
> kfree_sensitive(). kfree_sensitive() will zero the memory with
> memzero_explicit().
> 
> Fixes: 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()")
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
> Changes in v2:
>  - fixes tag added
> 
>  drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 -
>  1 file changed, 1 deletion(-)

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] 5+ messages in thread

end of thread, other threads:[~2020-09-04  8:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27  7:40 [PATCH] crypto: sun8i-ss - remove redundant memzero_explicit() Denis Efremov
2020-08-27  8:03 ` Corentin Labbe
2020-08-27 12:12   ` Denis Efremov
2020-08-27 12:16   ` [PATCH v2] " Denis Efremov
2020-09-04  8:28     ` 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).