diff mbox series

fixed caam driver handling of sg list.

Message ID 20190131070556.44832-1-pankaj.gupta@nxp.com (mailing list archive)
State Superseded
Delegated to: Herbert Xu
Headers show
Series fixed caam driver handling of sg list. | expand

Commit Message

Pankaj Gupta Jan. 31, 2019, 7:18 a.m. UTC
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.

Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Signed-off-by: Arun Pathak <arun.pathak@nxp.com>
---
 drivers/crypto/caam/caamalg.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Horia Geanta Jan. 31, 2019, 9:37 a.m. UTC | #1
Thanks Pankaj.

On 1/31/2019 9:18 AM, Pankaj Gupta wrote:
> 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: <stable@vger.kernel.org> # 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.
Horia Geanta Jan. 31, 2019, 11:20 a.m. UTC | #2
On 1/31/2019 11:38 AM, Horia Geanta wrote:
> Thanks Pankaj.
> 
> On 1/31/2019 9:18 AM, Pankaj Gupta wrote:
>> 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: <stable@vger.kernel.org> # 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")
> 
Actually for gcm the issue should show up from the very beginning, so
Fixes: f2147b88b2b1 ("crypto: caam - Convert GCM to new AEAD interface")
Cc: <stable@vger.kernel.org> # 4.2+
is better.

Thanks,
Horia
diff mbox series

Patch

diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index 2ec6e8cbf026..49f436230fb8 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -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 *