All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] crypto: caam - remove unneeded edesc zeroization
@ 2017-11-01  7:13 Horia Geantă
  2017-11-01  7:13 ` [PATCH 2/2] crypto: caam - remove unused param of ctx_map_to_sec4_sg() Horia Geantă
  2017-11-06  7:07 ` [PATCH 1/2] crypto: caam - remove unneeded edesc zeroization Herbert Xu
  0 siblings, 2 replies; 4+ messages in thread
From: Horia Geantă @ 2017-11-01  7:13 UTC (permalink / raw)
  To: Herbert Xu; +Cc: David S. Miller, Dan Douglass, Aymen Sghaier, linux-crypto

Extended descriptor allocation has been changed by
commit dde20ae9d6383 ("crypto: caam - Change kmalloc to kzalloc to avoid residual data")
to provide zeroized memory, meaning we no longer have to sanitize
its members - edesc->src_nents and edesc->dst_dma.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
---
 drivers/crypto/caam/caamhash.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index f1bf563cb85b..27fe1a07050c 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -820,7 +820,6 @@ static int ahash_final_ctx(struct ahash_request *req)
 	desc = edesc->hw_desc;
 
 	edesc->sec4_sg_bytes = sec4_sg_bytes;
-	edesc->src_nents = 0;
 
 	ret = ctx_map_to_sec4_sg(desc, jrdev, state, ctx->ctx_len,
 				 edesc->sec4_sg, DMA_TO_DEVICE);
@@ -1072,7 +1071,6 @@ static int ahash_final_no_ctx(struct ahash_request *req)
 		dev_err(jrdev, "unable to map dst\n");
 		goto unmap;
 	}
-	edesc->src_nents = 0;
 
 #ifdef DEBUG
 	print_hex_dump(KERN_ERR, "jobdesc@"__stringify(__LINE__)": ",
@@ -1154,7 +1152,6 @@ static int ahash_update_no_ctx(struct ahash_request *req)
 
 		edesc->src_nents = src_nents;
 		edesc->sec4_sg_bytes = sec4_sg_bytes;
-		edesc->dst_dma = 0;
 
 		ret = buf_map_to_sec4_sg(jrdev, edesc->sec4_sg, state);
 		if (ret)
@@ -1366,7 +1363,6 @@ static int ahash_update_first(struct ahash_request *req)
 		}
 
 		edesc->src_nents = src_nents;
-		edesc->dst_dma = 0;
 
 		ret = ahash_edesc_add_src(ctx, edesc, req, mapped_nents, 0, 0,
 					  to_hash);
-- 
2.12.0.264.gd6db3f216544

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

* [PATCH 2/2] crypto: caam - remove unused param of ctx_map_to_sec4_sg()
  2017-11-01  7:13 [PATCH 1/2] crypto: caam - remove unneeded edesc zeroization Horia Geantă
@ 2017-11-01  7:13 ` Horia Geantă
  2017-11-06  7:07   ` Herbert Xu
  2017-11-06  7:07 ` [PATCH 1/2] crypto: caam - remove unneeded edesc zeroization Herbert Xu
  1 sibling, 1 reply; 4+ messages in thread
From: Horia Geantă @ 2017-11-01  7:13 UTC (permalink / raw)
  To: Herbert Xu; +Cc: David S. Miller, Dan Douglass, Aymen Sghaier, linux-crypto

ctx_map_to_sec4_sg() function, added in
commit 045e36780f115 ("crypto: caam - ahash hmac support")
has never used the "desc" parameter, so let's drop it.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
---
 drivers/crypto/caam/caamhash.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index 27fe1a07050c..400e788b4f1c 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -211,7 +211,7 @@ static inline int buf_map_to_sec4_sg(struct device *jrdev,
 }
 
 /* Map state->caam_ctx, and add it to link table */
-static inline int ctx_map_to_sec4_sg(u32 *desc, struct device *jrdev,
+static inline int ctx_map_to_sec4_sg(struct device *jrdev,
 				     struct caam_hash_state *state, int ctx_len,
 				     struct sec4_sg_entry *sec4_sg, u32 flag)
 {
@@ -722,7 +722,7 @@ static int ahash_update_ctx(struct ahash_request *req)
 		edesc->src_nents = src_nents;
 		edesc->sec4_sg_bytes = sec4_sg_bytes;
 
-		ret = ctx_map_to_sec4_sg(desc, jrdev, state, ctx->ctx_len,
+		ret = ctx_map_to_sec4_sg(jrdev, state, ctx->ctx_len,
 					 edesc->sec4_sg, DMA_BIDIRECTIONAL);
 		if (ret)
 			goto unmap_ctx;
@@ -821,7 +821,7 @@ static int ahash_final_ctx(struct ahash_request *req)
 
 	edesc->sec4_sg_bytes = sec4_sg_bytes;
 
-	ret = ctx_map_to_sec4_sg(desc, jrdev, state, ctx->ctx_len,
+	ret = ctx_map_to_sec4_sg(jrdev, state, ctx->ctx_len,
 				 edesc->sec4_sg, DMA_TO_DEVICE);
 	if (ret)
 		goto unmap_ctx;
@@ -915,7 +915,7 @@ static int ahash_finup_ctx(struct ahash_request *req)
 
 	edesc->src_nents = src_nents;
 
-	ret = ctx_map_to_sec4_sg(desc, jrdev, state, ctx->ctx_len,
+	ret = ctx_map_to_sec4_sg(jrdev, state, ctx->ctx_len,
 				 edesc->sec4_sg, DMA_TO_DEVICE);
 	if (ret)
 		goto unmap_ctx;
-- 
2.12.0.264.gd6db3f216544

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

* Re: [PATCH 1/2] crypto: caam - remove unneeded edesc zeroization
  2017-11-01  7:13 [PATCH 1/2] crypto: caam - remove unneeded edesc zeroization Horia Geantă
  2017-11-01  7:13 ` [PATCH 2/2] crypto: caam - remove unused param of ctx_map_to_sec4_sg() Horia Geantă
@ 2017-11-06  7:07 ` Herbert Xu
  1 sibling, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2017-11-06  7:07 UTC (permalink / raw)
  To: Horia Geantă
  Cc: David S. Miller, Dan Douglass, Aymen Sghaier, linux-crypto

On Wed, Nov 01, 2017 at 09:13:10AM +0200, Horia Geantă wrote:
> Extended descriptor allocation has been changed by
> commit dde20ae9d6383 ("crypto: caam - Change kmalloc to kzalloc to avoid residual data")
> to provide zeroized memory, meaning we no longer have to sanitize
> its members - edesc->src_nents and edesc->dst_dma.
> 
> Signed-off-by: Horia Geantă <horia.geanta@nxp.com>

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

* Re: [PATCH 2/2] crypto: caam - remove unused param of ctx_map_to_sec4_sg()
  2017-11-01  7:13 ` [PATCH 2/2] crypto: caam - remove unused param of ctx_map_to_sec4_sg() Horia Geantă
@ 2017-11-06  7:07   ` Herbert Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2017-11-06  7:07 UTC (permalink / raw)
  To: Horia Geantă
  Cc: David S. Miller, Dan Douglass, Aymen Sghaier, linux-crypto

On Wed, Nov 01, 2017 at 09:13:11AM +0200, Horia Geantă wrote:
> ctx_map_to_sec4_sg() function, added in
> commit 045e36780f115 ("crypto: caam - ahash hmac support")
> has never used the "desc" parameter, so let's drop it.
> 
> Signed-off-by: Horia Geantă <horia.geanta@nxp.com>

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

end of thread, other threads:[~2017-11-06  7:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01  7:13 [PATCH 1/2] crypto: caam - remove unneeded edesc zeroization Horia Geantă
2017-11-01  7:13 ` [PATCH 2/2] crypto: caam - remove unused param of ctx_map_to_sec4_sg() Horia Geantă
2017-11-06  7:07   ` Herbert Xu
2017-11-06  7:07 ` [PATCH 1/2] crypto: caam - remove unneeded edesc zeroization 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.