1 From 42e95d1f10dcf8b18b1d7f52f7068985b3dc5b79 Mon Sep 17 00:00:00 2001
2 From: Pankaj Gupta <pankaj.gupta@nxp.com>
3 Date: Fri, 1 Feb 2019 07:18:20 +0000
4 Subject: crypto: caam - fixed handling of sg list
6 From: Pankaj Gupta <pankaj.gupta@nxp.com>
8 commit 42e95d1f10dcf8b18b1d7f52f7068985b3dc5b79 upstream.
10 when the source sg contains more than 1 fragment and
11 destination sg contains 1 fragment, the caam driver
12 mishandle the buffers to be sent to caam.
14 Fixes: f2147b88b2b1 ("crypto: caam - Convert GCM to new AEAD interface")
15 Cc: <stable@vger.kernel.org> # 4.2+
16 Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
17 Signed-off-by: Arun Pathak <arun.pathak@nxp.com>
18 Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
19 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23 drivers/crypto/caam/caamalg.c | 1 +
24 1 file changed, 1 insertion(+)
26 --- a/drivers/crypto/caam/caamalg.c
27 +++ b/drivers/crypto/caam/caamalg.c
28 @@ -2081,6 +2081,7 @@ static void init_aead_job(struct aead_re
29 if (unlikely(req->src != req->dst)) {
30 if (!edesc->dst_nents) {
31 dst_dma = sg_dma_address(req->dst);
34 dst_dma = edesc->sec4_sg_dma +