]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Oct 2015 14:19:04 +0000 (07:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Oct 2015 14:19:04 +0000 (07:19 -0700)
added patches:
crypto-ahash-ensure-statesize-is-non-zero.patch
crypto-sparc-initialize-blkcipher.ivsize.patch

queue-3.10/crypto-ahash-ensure-statesize-is-non-zero.patch [new file with mode: 0644]
queue-3.10/crypto-sparc-initialize-blkcipher.ivsize.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/crypto-ahash-ensure-statesize-is-non-zero.patch b/queue-3.10/crypto-ahash-ensure-statesize-is-non-zero.patch
new file mode 100644 (file)
index 0000000..bf13b1f
--- /dev/null
@@ -0,0 +1,37 @@
+From 8996eafdcbad149ac0f772fb1649fbb75c482a6a Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel@arm.linux.org.uk>
+Date: Fri, 9 Oct 2015 20:43:33 +0100
+Subject: crypto: ahash - ensure statesize is non-zero
+
+From: Russell King <rmk+kernel@arm.linux.org.uk>
+
+commit 8996eafdcbad149ac0f772fb1649fbb75c482a6a upstream.
+
+Unlike shash algorithms, ahash drivers must implement export
+and import as their descriptors may contain hardware state and
+cannot be exported as is.  Unfortunately some ahash drivers did
+not provide them and end up causing crashes with algif_hash.
+
+This patch adds a check to prevent these drivers from registering
+ahash algorithms until they are fixed.
+
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ crypto/ahash.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/crypto/ahash.c
++++ b/crypto/ahash.c
+@@ -462,7 +462,8 @@ static int ahash_prepare_alg(struct ahas
+       struct crypto_alg *base = &alg->halg.base;
+       if (alg->halg.digestsize > PAGE_SIZE / 8 ||
+-          alg->halg.statesize > PAGE_SIZE / 8)
++          alg->halg.statesize > PAGE_SIZE / 8 ||
++          alg->halg.statesize == 0)
+               return -EINVAL;
+       base->cra_type = &crypto_ahash_type;
diff --git a/queue-3.10/crypto-sparc-initialize-blkcipher.ivsize.patch b/queue-3.10/crypto-sparc-initialize-blkcipher.ivsize.patch
new file mode 100644 (file)
index 0000000..da4afaa
--- /dev/null
@@ -0,0 +1,68 @@
+From a66d7f724a96d6fd279bfbd2ee488def6b081bea Mon Sep 17 00:00:00 2001
+From: Dave Kleikamp <dave.kleikamp@oracle.com>
+Date: Mon, 5 Oct 2015 10:08:51 -0500
+Subject: crypto: sparc - initialize blkcipher.ivsize
+
+From: Dave Kleikamp <dave.kleikamp@oracle.com>
+
+commit a66d7f724a96d6fd279bfbd2ee488def6b081bea upstream.
+
+Some of the crypto algorithms write to the initialization vector,
+but no space has been allocated for it. This clobbers adjacent memory.
+
+Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/sparc/crypto/aes_glue.c      |    2 ++
+ arch/sparc/crypto/camellia_glue.c |    1 +
+ arch/sparc/crypto/des_glue.c      |    2 ++
+ 3 files changed, 5 insertions(+)
+
+--- a/arch/sparc/crypto/aes_glue.c
++++ b/arch/sparc/crypto/aes_glue.c
+@@ -433,6 +433,7 @@ static struct crypto_alg algs[] = { {
+               .blkcipher = {
+                       .min_keysize    = AES_MIN_KEY_SIZE,
+                       .max_keysize    = AES_MAX_KEY_SIZE,
++                      .ivsize         = AES_BLOCK_SIZE,
+                       .setkey         = aes_set_key,
+                       .encrypt        = cbc_encrypt,
+                       .decrypt        = cbc_decrypt,
+@@ -452,6 +453,7 @@ static struct crypto_alg algs[] = { {
+               .blkcipher = {
+                       .min_keysize    = AES_MIN_KEY_SIZE,
+                       .max_keysize    = AES_MAX_KEY_SIZE,
++                      .ivsize         = AES_BLOCK_SIZE,
+                       .setkey         = aes_set_key,
+                       .encrypt        = ctr_crypt,
+                       .decrypt        = ctr_crypt,
+--- a/arch/sparc/crypto/camellia_glue.c
++++ b/arch/sparc/crypto/camellia_glue.c
+@@ -274,6 +274,7 @@ static struct crypto_alg algs[] = { {
+               .blkcipher = {
+                       .min_keysize    = CAMELLIA_MIN_KEY_SIZE,
+                       .max_keysize    = CAMELLIA_MAX_KEY_SIZE,
++                      .ivsize         = CAMELLIA_BLOCK_SIZE,
+                       .setkey         = camellia_set_key,
+                       .encrypt        = cbc_encrypt,
+                       .decrypt        = cbc_decrypt,
+--- a/arch/sparc/crypto/des_glue.c
++++ b/arch/sparc/crypto/des_glue.c
+@@ -429,6 +429,7 @@ static struct crypto_alg algs[] = { {
+               .blkcipher = {
+                       .min_keysize    = DES_KEY_SIZE,
+                       .max_keysize    = DES_KEY_SIZE,
++                      .ivsize         = DES_BLOCK_SIZE,
+                       .setkey         = des_set_key,
+                       .encrypt        = cbc_encrypt,
+                       .decrypt        = cbc_decrypt,
+@@ -485,6 +486,7 @@ static struct crypto_alg algs[] = { {
+               .blkcipher = {
+                       .min_keysize    = DES3_EDE_KEY_SIZE,
+                       .max_keysize    = DES3_EDE_KEY_SIZE,
++                      .ivsize         = DES3_EDE_BLOCK_SIZE,
+                       .setkey         = des3_ede_set_key,
+                       .encrypt        = cbc3_encrypt,
+                       .decrypt        = cbc3_decrypt,
index a8cdad64924b86d274e587032db0ec3220c9225a..7ecfe7ecb51ed6859583a1e61d7f81b39cfd16f5 100644 (file)
@@ -9,3 +9,5 @@ ethtool-use-kcalloc-instead-of-kmalloc-for-ethtool_get_strings.patch
 asix-don-t-reset-phy-on-if_up-for-asix-88772.patch
 asix-do-full-reset-during-ax88772_bind.patch
 m68k-uaccess-fix-asm-constraints-for-userspace-access.patch
+crypto-sparc-initialize-blkcipher.ivsize.patch
+crypto-ahash-ensure-statesize-is-non-zero.patch