]> www.infradead.org Git - users/dwmw2/linux.git/commit
crypto: x86/cast5-avx - fix ECB encryption when long sg follows short one
authorEric Biggers <ebiggers@google.com>
Tue, 20 Feb 2018 07:48:12 +0000 (23:48 -0800)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:33:57 +0000 (21:33 -0400)
commitcc24affe077526b5bd1da9e0f21dd794d293c42d
tree633feaa90f65a2171262a78f74305963c166503c
parent6e4e9aa776470baf9505a9df5bf4b1c2153aef5d
crypto: x86/cast5-avx - fix ECB encryption when long sg follows short one

[ Upstream commit 8f461b1e02ed546fbd0f11611138da67fd85a30f ]

With ecb-cast5-avx, if a 128+ byte scatterlist element followed a
shorter one, then the algorithm accidentally encrypted/decrypted only 8
bytes instead of the expected 128 bytes.  Fix it by setting the
encryption/decryption 'fn' correctly.

Fixes: c12ab20b162c ("crypto: cast5/avx - avoid using temporary stack buffers")
Cc: <stable@vger.kernel.org> # v3.8+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
arch/x86/crypto/cast5_avx_glue.c