linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: inside-secure - use kfree_sensitive()
@ 2020-08-26 13:15 Denis Efremov
  2020-08-26 13:30 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Efremov @ 2020-08-26 13:15 UTC (permalink / raw)
  To: linux-crypto
  Cc: Denis Efremov, Antoine Tenart, Herbert Xu, David S. Miller, linux-kernel

Use kfree_sensitive() instead of open-coding it.

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 drivers/crypto/inside-secure/safexcel_hash.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
index 16a467969d8e..5ffdc1cd5847 100644
--- a/drivers/crypto/inside-secure/safexcel_hash.c
+++ b/drivers/crypto/inside-secure/safexcel_hash.c
@@ -1082,8 +1082,7 @@ static int safexcel_hmac_init_pad(struct ahash_request *areq,
 		}
 
 		/* Avoid leaking */
-		memzero_explicit(keydup, keylen);
-		kfree(keydup);
+		kfree_sensitive(keydup);
 
 		if (ret)
 			return ret;
-- 
2.26.2


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

* Re: [PATCH] crypto: inside-secure - use kfree_sensitive()
  2020-08-26 13:15 [PATCH] crypto: inside-secure - use kfree_sensitive() Denis Efremov
@ 2020-08-26 13:30 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2020-08-26 13:30 UTC (permalink / raw)
  To: Denis Efremov; +Cc: linux-crypto, Antoine Tenart, David S. Miller, linux-kernel

On Wed, Aug 26, 2020 at 04:15:14PM +0300, Denis Efremov wrote:
> Use kfree_sensitive() instead of open-coding it.
> 
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>  drivers/crypto/inside-secure/safexcel_hash.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Please redo this as a patch series.

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

end of thread, other threads:[~2020-08-26 13:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26 13:15 [PATCH] crypto: inside-secure - use kfree_sensitive() Denis Efremov
2020-08-26 13:30 ` 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).