]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/crypto-caam-fixed-handling-of-sg-list.patch
drop some duplicated patches that somehow got merged.
[thirdparty/kernel/stable-queue.git] / queue-4.14 / crypto-caam-fixed-handling-of-sg-list.patch
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
5
6 From: Pankaj Gupta <pankaj.gupta@nxp.com>
7
8 commit 42e95d1f10dcf8b18b1d7f52f7068985b3dc5b79 upstream.
9
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.
13
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>
21
22 ---
23 drivers/crypto/caam/caamalg.c | 1 +
24 1 file changed, 1 insertion(+)
25
26 --- a/drivers/crypto/caam/caamalg.c
27 +++ b/drivers/crypto/caam/caamalg.c
28 @@ -1097,6 +1097,7 @@ static void init_ablkcipher_job(u32 *sh_
29 } else {
30 if (edesc->dst_nents == 1) {
31 dst_dma = sg_dma_address(req->dst);
32 + out_options = 0;
33 } else {
34 dst_dma = edesc->sec4_sg_dma + (edesc->src_nents + 1) *
35 sizeof(struct sec4_sg_entry);