Skip to contentSkip to conversation

fixed caam driver handling of sg list.

PATCH In review Pankaj Gupta 3 participants 7 messages Jan 31, 2019 – Feb 8, 2019 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): Pankaj Gupta <[email protected]

Pankaj Gupta

author maintainer
#1 lore raw

PATCH 1/1 fixed caam driver handling of sg list.

when the source sg contains more than 1 fragment and destination sg contains 1 fragment, the caam driver mishandle the buffers to be sent to caam.

---
 drivers/crypto/caam/caamalg.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/caam/caamalg.c +1 -0
index 2ec6e8cbf026..49f436230fb8 100644
@@ -1056,6 +1056,7 @@ static void init_aead_job(struct aead_request *req,
 	if (unlikely(req->src != req->dst)) {
 		if (edesc->dst_nents == 1) {
 			dst_dma = sg_dma_address(req->dst);
+			out_options = 0;
 		} else {
 			dst_dma = edesc->sec4_sg_dma +
 				  sec4_sg_index *
Signature · 1 line
2.17.1
maintainer
#2 lore raw

Thanks Pankaj.

Quoted 4 lines · Pankaj Gupta

when the source sg contains more than 1 fragment and destination sg contains 1 fragment, the caam driver mishandle the buffers to be sent to caam.

Patch subject prefix should be: "crypto: caam -"

Please Cc stable by adding:
Cc: <[email protected]> # 4.3+

The root cause is commit:
f2147b88b2b1 ("crypto: caam - Convert GCM to new AEAD interface")

however the issue was not visible until the switch to new AEAD interface completed, in commit:
479bcc7c5b9e ("crypto: caam - Convert authenc to new AEAD interface")

Thus it's probably correct to also add

Fixes 479bcc7c5b9e ("crypto: caam - Convert authenc to new AEAD interface")

Horia

P.S. You are supposed to add driver maintainers in the loop, see MAINTAINERS file and the handy scripts/get_maintainer.pl.

maintainer
#3 lore raw
Quoted 15 lines · Horia Geanta

Thanks Pankaj.

Quoted 4 lines · Pankaj Gupta

when the source sg contains more than 1 fragment and destination sg contains 1 fragment, the caam driver mishandle the buffers to be sent to caam.

Patch subject prefix should be: "crypto: caam -"

Please Cc stable by adding:
Cc: <[email protected]> # 4.3+

The root cause is commit:
f2147b88b2b1 ("crypto: caam - Convert GCM to new AEAD interface")

Quoted 7 lines

however the issue was not visible until the switch to new AEAD interface completed, in commit:
479bcc7c5b9e ("crypto: caam - Convert authenc to new AEAD interface")

Thus it's probably correct to also add

Fixes 479bcc7c5b9e ("crypto: caam - Convert authenc to new AEAD interface")

Actually for gcm the issue should show up from the very beginning, so

Fixes f2147b88b2b1 ("crypto: caam - Convert GCM to new AEAD interface")
Cc <[email protected]> # 4.2+

is better.

Thanks,
Horia

author maintainer
#4 lore raw

PATCH v2 1/1 crypto: caam - fixed handling of sg list

In reply to Pankaj Gupta

when the source sg contains more than 1 fragment and destination sg contains 1 fragment, the caam driver mishandle the buffers to be sent to caam.

Fixes f2147b88b2b1 ("crypto: caam - Convert GCM to new AEAD interface")
Cc <[email protected]> # 4.2+
---
 drivers/crypto/caam/caamalg.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/caam/caamalg.c +1 -0
index 2ec6e8cbf026..49f436230fb8 100644
@@ -1056,6 +1056,7 @@ static void init_aead_job(struct aead_request *req,
 	if (unlikely(req->src != req->dst)) {
 		if (edesc->dst_nents == 1) {
 			dst_dma = sg_dma_address(req->dst);
+			out_options = 0;
 		} else {
 			dst_dma = edesc->sec4_sg_dma +
 				  sec4_sg_index *
Signature · 1 line
2.17.1
maintainer Reviewed-by on v2 1/1
#5 lore raw

Re: [PATCHv2] crypto: caam - fixed handling of sg list

Quoted 8 lines · Pankaj Gupta

when the source sg contains more than 1 fragment and destination sg contains 1 fragment, the caam driver mishandle the buffers to be sent to caam.

Fixes f2147b88b2b1 ("crypto: caam - Convert GCM to new AEAD interface")
Cc <[email protected]> # 4.2+

Thanks,
Horia

author maintainer
#6 lore raw

PATCH v3 1/1 crypto: caam - fixed handling of sg list

In reply to Pankaj Gupta

when the source sg contains more than 1 fragment and destination sg contains 1 fragment, the caam driver mishandle the buffers to be sent to caam.

Fixes f2147b88b2b1 ("crypto: caam - Convert GCM to new AEAD interface")
Cc <[email protected]> # 4.2+
---
 drivers/crypto/caam/caamalg.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/caam/caamalg.c +1 -0
index 2ec6e8cbf026..49f436230fb8 100644
@@ -1056,6 +1056,7 @@ static void init_aead_job(struct aead_request *req,
 	if (unlikely(req->src != req->dst)) {
 		if (edesc->dst_nents == 1) {
 			dst_dma = sg_dma_address(req->dst);
+			out_options = 0;
 		} else {
 			dst_dma = edesc->sec4_sg_dma +
 				  sec4_sg_index *
Signature · 1 line
2.17.1
maintainer
#7 lore raw

Re: [PATCH v3] crypto: caam - fixed handling of sg list

Quoted 4 lines · Pankaj Gupta

when the source sg contains more than 1 fragment and destination sg contains 1 fragment, the caam driver mishandle the buffers to be sent to caam.

Quoted 8 lines
Fixes f2147b88b2b1 ("crypto: caam - Convert GCM to new AEAD interface")
Cc <[email protected]> # 4.2+
---
 drivers/crypto/caam/caamalg.c | 1 +
 1 file changed, 1 insertion(+)

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