]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: ccree - don't copy zero size ciphertext
authorGilad Ben-Yossef <gilad@benyossef.com>
Tue, 15 Jan 2019 13:43:17 +0000 (15:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:09:40 +0000 (20:09 +0100)
commit6ed42ccca59db6c871f00c5746a769e5154324b6
tree98671fd20a779a28ca79dd2e7f75af6b3c56db91
parent0bdd345a384849d6d194dd84cd60b0ccc69fd8d1
crypto: ccree - don't copy zero size ciphertext

commit 2b5ac17463dcb2411fed506edcf259a89bb538ba upstream.

For decryption in CBC mode we need to save the last ciphertext block
for use as the next IV. However, we were trying to do this also with
zero sized ciphertext resulting in a panic.

Fix this by only doing the copy if the ciphertext length is at least
of IV size.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: stable@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/ccree/cc_cipher.c