android_kernel_oneplus_msm8998/drivers/crypto
Herbert Xu 3ef726179c crypto: padlock-aes - Fix Nano workaround data corruption
commit 46d8c4b28652d35dc6cfb5adf7f54e102fc04384 upstream.

This was detected by the self-test thanks to Ard's chunking patch.

I finally got around to testing this out on my ancient Via box.  It
turns out that the workaround got the assembly wrong and we end up
doing count + initial cycles of the loop instead of just count.

This obviously causes corruption, either by overwriting the source
that is yet to be processed, or writing over the end of the buffer.

On CPUs that don't require the workaround only ECB is affected.
On Nano CPUs both ECB and CBC are affected.

This patch fixes it by doing the subtraction prior to the assembly.

Fixes: a76c1c23d0 ("crypto: padlock-aes - work around Nano CPU...")
Cc: <stable@vger.kernel.org>
Reported-by: Jamie Heilman <jamie@audible.transient.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-06 16:24:42 +02:00
..
amcc crypto: crypto4xx - fix crypto4xx_build_pdr, crypto4xx_build_sdr leak 2018-07-22 14:25:52 +02:00
caam crypto: caam - fix endless loop when DECO acquire fails 2018-02-16 20:09:45 +01:00
ccp
marvell
nx
qat
qce
sunxi-ss crypto: sunxi-ss - Add MODULE_ALIAS to sun4i-ss 2018-05-30 07:49:16 +02:00
ux500
vmx crypto: vmx - Remove overly verbose printk from AES init routines 2018-06-16 09:54:27 +02:00
atmel-aes-regs.h
atmel-aes.c
atmel-sha-regs.h
atmel-sha.c crypto: atmel - only treat EBUSY as transient if backlog 2017-07-21 07:44:58 +02:00
atmel-tdes-regs.h
atmel-tdes.c
bfin_crc.c
bfin_crc.h
geode-aes.c
geode-aes.h
hifn_795x.c
img-hash.c
ixp4xx_crypto.c
Kconfig
Makefile
mv_cesa.c
mv_cesa.h
mxs-dcp.c
n2_asm.S
n2_core.c crypto: n2 - cure use after free 2018-01-10 09:27:08 +01:00
n2_core.h
omap-aes.c
omap-des.c
omap-sham.c
padlock-aes.c crypto: padlock-aes - Fix Nano workaround data corruption 2018-08-06 16:24:42 +02:00
padlock-sha.c x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros 2018-06-16 09:54:24 +02:00
picoxcell_crypto.c
picoxcell_crypto_regs.h
s5p-sss.c crypto: s5p-sss - Fix kernel Oops in AES-ECB mode 2018-02-25 11:03:55 +01:00
sahara.c
talitos.c crypto: talitos - fix sha224 2017-10-05 09:41:45 +02:00
talitos.h