All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "crypto: xts - Propagate NEED_FALLBACK bit" has been added to the 4.10-stable tree
@ 2017-03-10  7:50 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-03-10  7:50 UTC (permalink / raw)
  To: herbert, freude, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    crypto: xts - Propagate NEED_FALLBACK bit

to the 4.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     crypto-xts-propagate-need_fallback-bit.patch
and it can be found in the queue-4.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 89027579bc6c2febbcc9c2f9d5069adf71539e4b Mon Sep 17 00:00:00 2001
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Sun, 26 Feb 2017 12:24:10 +0800
Subject: crypto: xts - Propagate NEED_FALLBACK bit

From: Herbert Xu <herbert@gondor.apana.org.au>

commit 89027579bc6c2febbcc9c2f9d5069adf71539e4b upstream.

When we're used as a fallback algorithm, we should propagate
the NEED_FALLBACK bit when searching for the underlying ECB mode.

This just happens to fix a hang too because otherwise the search
may end up loading the same module that triggered this XTS creation.

Fixes: f1c131b45410 ("crypto: xts - Convert to skcipher")
Reported-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 crypto/xts.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

--- a/crypto/xts.c
+++ b/crypto/xts.c
@@ -463,6 +463,7 @@ static int create(struct crypto_template
 	struct xts_instance_ctx *ctx;
 	struct skcipher_alg *alg;
 	const char *cipher_name;
+	u32 mask;
 	int err;
 
 	algt = crypto_get_attr_type(tb);
@@ -483,18 +484,19 @@ static int create(struct crypto_template
 	ctx = skcipher_instance_ctx(inst);
 
 	crypto_set_skcipher_spawn(&ctx->spawn, skcipher_crypto_instance(inst));
-	err = crypto_grab_skcipher(&ctx->spawn, cipher_name, 0,
-				   crypto_requires_sync(algt->type,
-							algt->mask));
+
+	mask = crypto_requires_off(algt->type, algt->mask,
+				   CRYPTO_ALG_NEED_FALLBACK |
+				   CRYPTO_ALG_ASYNC);
+
+	err = crypto_grab_skcipher(&ctx->spawn, cipher_name, 0, mask);
 	if (err == -ENOENT) {
 		err = -ENAMETOOLONG;
 		if (snprintf(ctx->name, CRYPTO_MAX_ALG_NAME, "ecb(%s)",
 			     cipher_name) >= CRYPTO_MAX_ALG_NAME)
 			goto err_free_inst;
 
-		err = crypto_grab_skcipher(&ctx->spawn, ctx->name, 0,
-					   crypto_requires_sync(algt->type,
-								algt->mask));
+		err = crypto_grab_skcipher(&ctx->spawn, ctx->name, 0, mask);
 	}
 
 	if (err)


Patches currently in stable-queue which might be from herbert@gondor.apana.org.au are

queue-4.10/crypto-api-add-crypto_requires_off-helper.patch
queue-4.10/crypto-testmgr-pad-aes_ccm_enc_tv_template-vector.patch
queue-4.10/crypto-vmx-use-skcipher-for-xts-fallback.patch
queue-4.10/crypto-xts-add-ecb-dependency.patch
queue-4.10/crypto-vmx-use-skcipher-for-cbc-fallback.patch
queue-4.10/crypto-xts-propagate-need_fallback-bit.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-10  7:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-10  7:50 Patch "crypto: xts - Propagate NEED_FALLBACK bit" has been added to the 4.10-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.