Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+13 -3
+3
arch/s390/crypto/aes_s390.c
··· 820 820 else 821 821 memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE); 822 822 spin_unlock(&ctrblk_lock); 823 + } else { 824 + if (!nbytes) 825 + memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE); 823 826 } 824 827 /* 825 828 * final block may be < AES_BLOCK_SIZE, copy only nbytes
+3
arch/s390/crypto/des_s390.c
··· 429 429 else 430 430 memcpy(walk->iv, ctrptr, DES_BLOCK_SIZE); 431 431 spin_unlock(&ctrblk_lock); 432 + } else { 433 + if (!nbytes) 434 + memcpy(walk->iv, ctrptr, DES_BLOCK_SIZE); 432 435 } 433 436 /* final block may be < DES_BLOCK_SIZE, copy only nbytes */ 434 437 if (nbytes) {
+7 -3
drivers/crypto/caam/error.c
··· 16 16 char *tmp; \ 17 17 \ 18 18 tmp = kmalloc(sizeof(format) + max_alloc, GFP_ATOMIC); \ 19 - sprintf(tmp, format, param); \ 20 - strcat(str, tmp); \ 21 - kfree(tmp); \ 19 + if (likely(tmp)) { \ 20 + sprintf(tmp, format, param); \ 21 + strcat(str, tmp); \ 22 + kfree(tmp); \ 23 + } else { \ 24 + strcat(str, "kmalloc failure in SPRINTFCAT"); \ 25 + } \ 22 26 } 23 27 24 28 static void report_jump_idx(u32 status, char *outstr)