aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-16 10:53:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-16 10:53:33 -0400
commitaa57e0b281453334267e836d15cfdb933f6d6f97 (patch)
tree2c3e1dc9a396550317e15f4be9f7e0d101bf501e
parent865ca084fdc68cd9b658da4b098008278da8fed3 (diff)
parent84cba178a3b88efe2668a9039f70abda072faa21 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This fixes the following issues: - The selftest overreads the IV test vector. - Fix potential infinite loop in sunxi-ss driver. - Fix powerpc build failure when VMX is set without VSX" * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: testmgr - don't copy from source IV too much crypto: sunxi-ss - Fix a possible driver hang with ciphers crypto: vmx - VMX crypto should depend on CONFIG_VSX
-rw-r--r--crypto/testmgr.c5
-rw-r--r--drivers/crypto/Kconfig2
-rw-r--r--drivers/crypto/sunxi-ss/sun4i-ss-cipher.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 35c2de136971..fa18753f5c34 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -940,6 +940,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
940 char *xbuf[XBUFSIZE]; 940 char *xbuf[XBUFSIZE];
941 char *xoutbuf[XBUFSIZE]; 941 char *xoutbuf[XBUFSIZE];
942 int ret = -ENOMEM; 942 int ret = -ENOMEM;
943 unsigned int ivsize = crypto_skcipher_ivsize(tfm);
943 944
944 if (testmgr_alloc_buf(xbuf)) 945 if (testmgr_alloc_buf(xbuf))
945 goto out_nobuf; 946 goto out_nobuf;
@@ -975,7 +976,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
975 continue; 976 continue;
976 977
977 if (template[i].iv) 978 if (template[i].iv)
978 memcpy(iv, template[i].iv, MAX_IVLEN); 979 memcpy(iv, template[i].iv, ivsize);
979 else 980 else
980 memset(iv, 0, MAX_IVLEN); 981 memset(iv, 0, MAX_IVLEN);
981 982
@@ -1051,7 +1052,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
1051 continue; 1052 continue;
1052 1053
1053 if (template[i].iv) 1054 if (template[i].iv)
1054 memcpy(iv, template[i].iv, MAX_IVLEN); 1055 memcpy(iv, template[i].iv, ivsize);
1055 else 1056 else
1056 memset(iv, 0, MAX_IVLEN); 1057 memset(iv, 0, MAX_IVLEN);
1057 1058
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 07bc7aa6b224..d234719065a5 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -461,7 +461,7 @@ config CRYPTO_DEV_QCE
461 461
462config CRYPTO_DEV_VMX 462config CRYPTO_DEV_VMX
463 bool "Support for VMX cryptographic acceleration instructions" 463 bool "Support for VMX cryptographic acceleration instructions"
464 depends on PPC64 464 depends on PPC64 && VSX
465 help 465 help
466 Support for VMX cryptographic acceleration instructions. 466 Support for VMX cryptographic acceleration instructions.
467 467
diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
index e070c316e8b7..a19ee127edca 100644
--- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
@@ -104,7 +104,7 @@ static int sun4i_ss_opti_poll(struct ablkcipher_request *areq)
104 sg_miter_next(&mo); 104 sg_miter_next(&mo);
105 oo = 0; 105 oo = 0;
106 } 106 }
107 } while (mo.length > 0); 107 } while (oleft > 0);
108 108
109 if (areq->info) { 109 if (areq->info) {
110 for (i = 0; i < 4 && i < ivsize / 4; i++) { 110 for (i = 0; i < 4 && i < ivsize / 4; i++) {