crypto: talitos - fix use of sg_link_tbl_len
authorLEROY Christophe <christophe.leroy@c-s.fr>
Fri, 6 Oct 2017 13:04:41 +0000 (15:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Dec 2017 08:53:04 +0000 (09:53 +0100)
commit fbb22137c4d9bab536958b152d096fb3f98020ea upstream.

sg_link_tbl_len shall be used instead of cryptlen, otherwise
SECs which perform HW CICV verification will fail.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/talitos.c

index b7184f305867e130a363c761a7ef0f737fe2f8b7..cf5c9701b89833ec7a5e9772e81d37f09a208d67 100644 (file)
@@ -1232,8 +1232,8 @@ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq,
                        sg_link_tbl_len += authsize;
        }
 
-       ret = talitos_sg_map(dev, areq->src, cryptlen, edesc, &desc->ptr[4],
-                            sg_count, areq->assoclen, tbl_off);
+       ret = talitos_sg_map(dev, areq->src, sg_link_tbl_len, edesc,
+                            &desc->ptr[4], sg_count, areq->assoclen, tbl_off);
 
        if (ret > 1) {
                tbl_off += ret;