path: root/crypto/morus640.c
diff options
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-24 06:31:54 +0800
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-24 06:31:54 +0800
commit2dd3f7c904cce0d4b0e4684a62ce8b9024f8efda (patch)
treecc0f95fe853e35bbd06a18c423f63e8baa2aa171 /crypto/morus640.c
parentb13fbe77132575f621ce992a9be47d067a606308 (diff)
parent837bf7cc3b7504385ae0e829c72e470dfc27cf6c (diff)
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: - Fix use after free in chtls - Fix RBP breakage in sha3 - Fix use after free in hwrng_unregister - Fix overread in morus640 - Move sleep out of kernel_neon in arm64/aes-blk * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: hwrng: core - Always drop the RNG in hwrng_unregister() crypto: morus640 - Fix out-of-bounds access crypto: don't optimize keccakf() crypto: arm64/aes-blk - fix and move skcipher_walk_done out of kernel_neon_begin, _end crypto: chtls - use after free in chtls_pt_recvmsg()
Diffstat (limited to 'crypto/morus640.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/morus640.c b/crypto/morus640.c
index 9fbcde307daf..5eede3749e64 100644
--- a/crypto/morus640.c
+++ b/crypto/morus640.c
@@ -274,8 +274,9 @@ static void crypto_morus640_decrypt_chunk(struct morus640_state *state, u8 *dst,
union morus640_block_in tail;
memcpy(tail.bytes, src, size);
+ memset(tail.bytes + size, 0, MORUS640_BLOCK_SIZE - size);
- crypto_morus640_load_a(&m, src);
+ crypto_morus640_load_a(&m, tail.bytes);
crypto_morus640_core(state, &m);
crypto_morus640_store_a(tail.bytes, &m);
memset(tail.bytes + size, 0, MORUS640_BLOCK_SIZE - size);