]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop queue-5.8/crypto-caam-add-xts-check-for-block-length-equal-to-zero.patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Oct 2020 12:49:22 +0000 (14:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Oct 2020 12:49:22 +0000 (14:49 +0200)
queue-5.8/crypto-caam-add-xts-check-for-block-length-equal-to-zero.patch [deleted file]
queue-5.8/crypto-caam-qi-add-fallback-for-xts-with-more-than-8b-iv.patch
queue-5.8/crypto-caam-qi-add-support-for-more-xts-key-lengths.patch
queue-5.8/series

diff --git a/queue-5.8/crypto-caam-add-xts-check-for-block-length-equal-to-zero.patch b/queue-5.8/crypto-caam-add-xts-check-for-block-length-equal-to-zero.patch
deleted file mode 100644 (file)
index e83927a..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-From 297b931c2a3cada230d8b84432ee982fc68cf76a Mon Sep 17 00:00:00 2001
-From: Andrei Botila <andrei.botila@nxp.com>
-Date: Tue, 22 Sep 2020 19:03:25 +0300
-Subject: crypto: caam - add xts check for block length equal to zero
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Andrei Botila <andrei.botila@nxp.com>
-
-commit 297b931c2a3cada230d8b84432ee982fc68cf76a upstream.
-
-XTS should not return succes when dealing with block length equal to zero.
-This is different than the rest of the skcipher algorithms.
-
-Fixes: 31bb2f0da1b50 ("crypto: caam - check zero-length input")
-Cc: <stable@vger.kernel.org> # v5.4+
-Signed-off-by: Andrei Botila <andrei.botila@nxp.com>
-Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- drivers/crypto/caam/caamalg.c     |    7 ++++++-
- drivers/crypto/caam/caamalg_qi.c  |    7 ++++++-
- drivers/crypto/caam/caamalg_qi2.c |   14 ++++++++++++--
- 3 files changed, 24 insertions(+), 4 deletions(-)
-
---- a/drivers/crypto/caam/caamalg.c
-+++ b/drivers/crypto/caam/caamalg.c
-@@ -1765,7 +1765,12 @@ static inline int skcipher_crypt(struct
-       u32 *desc;
-       int ret = 0;
--      if (!req->cryptlen)
-+      /*
-+       * XTS is expected to return an error even for input length = 0
-+       * Note that the case input length < block size will be caught during
-+       * HW offloading and return an error.
-+       */
-+      if (!req->cryptlen && !ctx->fallback)
-               return 0;
-       /* allocate extended descriptor */
---- a/drivers/crypto/caam/caamalg_qi.c
-+++ b/drivers/crypto/caam/caamalg_qi.c
-@@ -1380,7 +1380,12 @@ static inline int skcipher_crypt(struct
-       struct caam_ctx *ctx = crypto_skcipher_ctx(skcipher);
-       int ret;
--      if (!req->cryptlen)
-+      /*
-+       * XTS is expected to return an error even for input length = 0
-+       * Note that the case input length < block size will be caught during
-+       * HW offloading and return an error.
-+       */
-+      if (!req->cryptlen && !ctx->fallback)
-               return 0;
-       if (unlikely(caam_congested))
---- a/drivers/crypto/caam/caamalg_qi2.c
-+++ b/drivers/crypto/caam/caamalg_qi2.c
-@@ -1451,7 +1451,12 @@ static int skcipher_encrypt(struct skcip
-       struct caam_request *caam_req = skcipher_request_ctx(req);
-       int ret;
--      if (!req->cryptlen)
-+      /*
-+       * XTS is expected to return an error even for input length = 0
-+       * Note that the case input length < block size will be caught during
-+       * HW offloading and return an error.
-+       */
-+      if (!req->cryptlen && !ctx->fallback)
-               return 0;
-       /* allocate extended descriptor */
-@@ -1482,7 +1487,12 @@ static int skcipher_decrypt(struct skcip
-       struct caam_request *caam_req = skcipher_request_ctx(req);
-       int ret;
--      if (!req->cryptlen)
-+      /*
-+       * XTS is expected to return an error even for input length = 0
-+       * Note that the case input length < block size will be caught during
-+       * HW offloading and return an error.
-+       */
-+      if (!req->cryptlen && !ctx->fallback)
-               return 0;
-       /* allocate extended descriptor */
-       edesc = skcipher_edesc_alloc(req);
index 3e5aa97daf173b537b12bdb1d358f83e3bde339c..f970254665debd189e776dcfa518afa4d55f82b6 100644 (file)
@@ -91,8 +91,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  static inline int skcipher_crypt(struct skcipher_request *req, bool encrypt)
  {
        struct skcipher_edesc *edesc;
-@@ -1388,6 +1407,21 @@ static inline int skcipher_crypt(struct
-       if (!req->cryptlen && !ctx->fallback)
+@@ -1383,6 +1402,21 @@ static inline int skcipher_crypt(struct
+       if (!req->cryptlen)
                return 0;
  
 +      if (ctx->fallback && xts_skcipher_ivsize(req)) {
@@ -113,7 +113,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        if (unlikely(caam_congested))
                return -EAGAIN;
  
-@@ -1512,6 +1546,7 @@ static struct caam_skcipher_alg driver_a
+@@ -1507,6 +1541,7 @@ static struct caam_skcipher_alg driver_a
                        .base = {
                                .cra_name = "xts(aes)",
                                .cra_driver_name = "xts-aes-caam-qi",
@@ -121,7 +121,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
                                .cra_blocksize = AES_BLOCK_SIZE,
                        },
                        .setkey = xts_skcipher_setkey,
-@@ -2445,9 +2480,32 @@ static int caam_cra_init(struct crypto_s
+@@ -2440,9 +2475,32 @@ static int caam_cra_init(struct crypto_s
        struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
        struct caam_skcipher_alg *caam_alg =
                container_of(alg, typeof(*caam_alg), skcipher);
@@ -156,7 +156,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  }
  
  static int caam_aead_init(struct crypto_aead *tfm)
-@@ -2473,7 +2531,11 @@ static void caam_exit_common(struct caam
+@@ -2468,7 +2526,11 @@ static void caam_exit_common(struct caam
  
  static void caam_cra_exit(struct crypto_skcipher *tfm)
  {
@@ -169,7 +169,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  }
  
  static void caam_aead_exit(struct crypto_aead *tfm)
-@@ -2507,7 +2569,7 @@ static void caam_skcipher_alg_init(struc
+@@ -2502,7 +2564,7 @@ static void caam_skcipher_alg_init(struc
        alg->base.cra_module = THIS_MODULE;
        alg->base.cra_priority = CAAM_CRA_PRIORITY;
        alg->base.cra_ctxsize = sizeof(struct caam_ctx);
index 42f45e4283018eb2f32fd220be19369f58843921..1a8e12b564975a2500a1e26511d847171e9bea3e 100644 (file)
@@ -62,8 +62,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        err = crypto_skcipher_setkey(ctx->fallback, key, keylen);
        if (err)
                return err;
-@@ -1407,7 +1413,8 @@ static inline int skcipher_crypt(struct
-       if (!req->cryptlen && !ctx->fallback)
+@@ -1402,7 +1408,8 @@ static inline int skcipher_crypt(struct
+       if (!req->cryptlen)
                return 0;
  
 -      if (ctx->fallback && xts_skcipher_ivsize(req)) {
index 8ae6fcf09ce6b9af0106552d030944442a601933..14164beb706ce1c931fcdad915ebbfd16101f8f3 100644 (file)
@@ -73,7 +73,6 @@ kvm-x86-mmu-commit-zap-of-remaining-invalid-pages-when-recovering-lpages.patch
 kvm-x86-intercept-la57-to-inject-gp-fault-when-it-s-reserved.patch
 kvm-svm-initialize-prev_ga_tag-before-use.patch
 ima-don-t-ignore-errors-from-crypto_shash_update.patch
-crypto-caam-add-xts-check-for-block-length-equal-to-zero.patch
 crypto-algif_aead-do-not-set-may_backlog-on-the-async-path.patch
 crypto-caam-qi-add-fallback-for-xts-with-more-than-8b-iv.patch
 crypto-caam-qi-add-support-for-more-xts-key-lengths.patch