]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
crypto: ccree - use the full crypt length value
authorGilad Ben-Yossef <gilad@benyossef.com>
Mon, 29 Jul 2019 10:40:18 +0000 (13:40 +0300)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 18 Oct 2019 08:26:33 +0000 (04:26 -0400)
BugLink: https://bugs.launchpad.net/bugs/1848039
commit 7a4be6c113c1f721818d1e3722a9015fe393295c upstream.

In case of AEAD decryption verifcation error we were using the
wrong value to zero out the plaintext buffer leaving the end of
the buffer with the false plaintext.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Fixes: ff27e85a85bb ("crypto: ccree - add AEAD support")
CC: stable@vger.kernel.org # v4.17+
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/crypto/ccree/cc_aead.c

index 7aa4cbe19a86f523ca390d0943b75a8c27e36876..29bf397cf0c17187d8d325b22ab9fae3110ce859 100644 (file)
@@ -236,7 +236,7 @@ static void cc_aead_complete(struct device *dev, void *cc_req, int err)
                        /* In case of payload authentication failure, MUST NOT
                         * revealed the decrypted message --> zero its memory.
                         */
-                       cc_zero_sgl(areq->dst, areq_ctx->cryptlen);
+                       cc_zero_sgl(areq->dst, areq->cryptlen);
                        err = -EBADMSG;
                }
        } else { /*ENCRYPT*/