summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-05-21 11:34:35 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2014-05-21 11:34:35 +0200
commit1f5518b4e7febc2a1026fba2ff311ba54be1abc4 (patch)
treeb637d1d99b876ae6ef721bcfe164a1338b958332 /arch
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending (diff)
parentcrypto: s390 - fix aes,des ctr mode concurrency finding. (diff)
downloadlinux-1f5518b4e7febc2a1026fba2ff311ba54be1abc4.tar.xz
linux-1f5518b4e7febc2a1026fba2ff311ba54be1abc4.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This fixes a NULL pointer dereference on allocation failure in caam, as well as a regression in the ctr mode on s390 that was added with the recent concurrency fixes" * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: s390 - fix aes,des ctr mode concurrency finding. crypto: caam - add allocation failure handling in SPRINTFCAT macro
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/crypto/aes_s390.c3
-rw-r--r--arch/s390/crypto/des_s390.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c
index cf3c0089bef2..23223cd63e54 100644
--- a/arch/s390/crypto/aes_s390.c
+++ b/arch/s390/crypto/aes_s390.c
@@ -820,6 +820,9 @@ static int ctr_aes_crypt(struct blkcipher_desc *desc, long func,
else
memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE);
spin_unlock(&ctrblk_lock);
+ } else {
+ if (!nbytes)
+ memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE);
}
/*
* final block may be < AES_BLOCK_SIZE, copy only nbytes
diff --git a/arch/s390/crypto/des_s390.c b/arch/s390/crypto/des_s390.c
index 0a5aac8a9412..7acb77f7ef1a 100644
--- a/arch/s390/crypto/des_s390.c
+++ b/arch/s390/crypto/des_s390.c
@@ -429,6 +429,9 @@ static int ctr_desall_crypt(struct blkcipher_desc *desc, long func,
else
memcpy(walk->iv, ctrptr, DES_BLOCK_SIZE);
spin_unlock(&ctrblk_lock);
+ } else {
+ if (!nbytes)
+ memcpy(walk->iv, ctrptr, DES_BLOCK_SIZE);
}
/* final block may be < DES_BLOCK_SIZE, copy only nbytes */
if (nbytes) {