[PATCH] crypto: vmx/xts - reject inputs that are too short

Herbert Xu herbert at gondor.apana.org.au
Thu Jan 16 18:28:55 AEDT 2020


On Wed, Jan 08, 2020 at 04:06:46PM +1100, Daniel Axtens wrote:
> When the kernel XTS implementation was extended to deal with ciphertext
> stealing in commit 8083b1bf8163 ("crypto: xts - add support for ciphertext
> stealing"), a check was added to reject inputs that were too short.
> 
> However, in the vmx enablement - commit 239668419349 ("crypto: vmx/xts -
> use fallback for ciphertext stealing"), that check wasn't added to the
> vmx implementation. This disparity leads to errors like the following:
> 
> alg: skcipher: p8_aes_xts encryption unexpectedly succeeded on test vector "random: len=0 klen=64"; expected_error=-22, cfg="random: inplace may_sleep use_finup src_divs=[<flush>66.99%@+10, 33.1%@alignmask+1155]"
> 
> Return -EINVAL if asked to operate with a cryptlen smaller than the AES
> block size. This brings vmx in line with the generic implementation.
> 
> Reported-by: Erhard Furtner <erhard_f at mailbox.org>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=206049
> Fixes: 239668419349 ("crypto: vmx/xts - use fallback for ciphertext stealing")
> Cc: Ard Biesheuvel <ard.biesheuvel at linaro.org>
> Cc: stable at vger.kernel.org # v5.4+
> Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
> [dja: commit message]
> Signed-off-by: Daniel Axtens <dja at axtens.net>
> ---
>  drivers/crypto/vmx/aes_xts.c | 3 +++
>  1 file changed, 3 insertions(+)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


More information about the Linuxppc-dev mailing list