Skip to contentSkip to conversation

crypto: sun8i-ss - remove redundant memzero_explicit()

PATCH Superseded Denis Efremov 3 participants 5 messages Aug 27, 2020 – Sep 4, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: sun8i-ss - remove redundant memzero_explicit()

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

---
 drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 -
 1 file changed, 1 deletion(-)
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c +0 -1
index deb8b39a86db..ed2a69f82e1c 100644
@@ -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,
Signature · 1 line
2.26.2
maintainer
#1 lore raw
Quoted 24 lines · Denis Efremov

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

---
 drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 -
 1 file changed, 1 deletion(-)
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c +0 -1
index deb8b39a86db..ed2a69f82e1c 100644
@@ -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,
Signature · 1 line
2.26.2

Hello

Could you add:

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

Regards

#2 lore raw
Quoted 2 lines · Corentin Labbe

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

#3 lore raw

PATCH v2 1/1 crypto: sun8i-ss - remove redundant memzero_explicit()

In reply to Corentin Labbe

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()")

---
Changes in v2:
- fixes tag added

 drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 -
 1 file changed, 1 deletion(-)
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c +0 -1
index deb8b39a86db..ed2a69f82e1c 100644
@@ -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,
Signature · 1 line
2.26.2
maintainer
#4 lore raw
Quoted 4 lines · Denis Efremov

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

Quoted 8 lines
Fixes 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()")

---
Changes in v2:
- fixes tag added

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

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt