1
0
Fork 0
remarkable-linux/drivers/crypto
Herbert Xu 51ef850c78 crypto: padlock-aes - Fix Nano workaround data corruption
commit 46d8c4b286 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:20:51 +02:00
..
amcc crypto: crypto4xx - fix crypto4xx_build_pdr, crypto4xx_build_sdr leak 2018-07-22 14:28:43 +02:00
axis crypto: artpec6 - set correct iv size for gcm(aes) 2018-03-24 11:01:28 +01:00
bcm crypto: brcm - Explicity ACK mailbox message 2017-11-21 09:49:21 +01:00
caam crypto: caam - fix size of RSA prime factor q 2018-06-16 09:45:17 +02:00
cavium crypto: cavium - Limit result reading attempts 2018-06-16 09:45:18 +02:00
ccp crypto: ccp - don't disable interrupts while setting up debugfs 2018-05-25 16:17:44 +02:00
chelsio crypto: chelsio - select CRYPTO_GF128MUL 2018-01-10 09:31:18 +01:00
inside-secure crypto: inside-secure - fix the invalidation step during cra_exit 2018-05-25 16:17:46 +02:00
marvell License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mediatek crypto: mediatek - fix error return code in mtk_crypto_probe() 2017-07-18 17:50:54 +08:00
nx License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
qat License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
qce License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rockchip License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stm32 crypto: hash - annotate algorithms taking optional key 2018-02-16 20:23:00 +01:00
sunxi-ss crypto: sunxi-ss - Add MODULE_ALIAS to sun4i-ss 2018-05-25 16:17:45 +02:00
ux500 scripts/spelling.txt: add "disble(d)" pattern and fix typo instances 2017-03-09 17:01:09 -08:00
virtio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vmx crypto: vmx - Remove overly verbose printk from AES XTS init 2018-06-16 09:45:18 +02:00
Kconfig crypto: artpec6 - remove select on non-existing CRYPTO_SHA384 2018-04-26 11:02:12 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-aes-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-aes.c crypto: atmel-aes - fix the keys zeroing on errors 2018-05-25 16:17:44 +02:00
atmel-authenc.h crypto: atmel-authenc - add support to authenc(hmac(shaX), Y(aes)) modes 2017-02-03 18:16:14 +08:00
atmel-ecc.c crypto: atmel-ecc - fix signed integer to u8 assignment 2017-08-03 13:47:23 +08:00
atmel-ecc.h crypto: atmel-ecc - introduce Microchip / Atmel ECC driver 2017-07-18 17:50:58 +08:00
atmel-sha-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-sha.c crypto: atmel-sha - remove unnecessary static in atmel_sha_remove() 2017-08-03 13:47:16 +08:00
atmel-tdes-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-tdes.c crypto: atmel-tdes - remove unnecessary static in atmel_tdes_remove() 2017-08-03 13:47:18 +08:00
bfin_crc.c crypto: hash - annotate algorithms taking optional key 2018-02-16 20:23:00 +01:00
bfin_crc.h crypto: bfin_crc - Remove unneeded linux/miscdevice.h include 2016-12-27 17:50:51 +08:00
exynos-rng.c crypto: exynos - Add new Exynos RNG driver 2017-04-21 20:30:46 +08:00
geode-aes.c crypto: geode-aes - fixed coding style warnings and error 2017-07-18 18:15:57 +08:00
geode-aes.h crypto: geode - Consistently use AES_KEYSIZE_128 2014-05-22 21:03:12 +08:00
hifn_795x.c crypto: squash lines for simple wrapper functions 2016-09-13 20:27:26 +08:00
img-hash.c crypto: img-hash - remove unnecessary static in img_hash_remove() 2017-08-03 13:47:18 +08:00
ixp4xx_crypto.c crypto: ixp4xx - Fix error handling path in 'aead_perform()' 2017-08-09 20:01:33 +08:00
mv_cesa.c crypto: mv_cesa - Use IPAD/OPAD constant 2017-05-23 12:52:08 +08:00
mv_cesa.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mxc-scc.c crypto: mxc-scc - fix error code in mxc_scc_probe() 2017-07-18 17:50:54 +08:00
mxs-dcp.c crypto: mxs-dcp - print error message on platform_get_irq failure 2017-07-18 17:50:54 +08:00
n2_asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
n2_core.c crypto: n2 - cure use after free 2018-01-10 09:31:18 +01:00
n2_core.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
omap-aes-gcm.c crypto: omap-aes - fix spelling mistake "Encryptio" -> "Encryption" 2017-06-20 11:21:29 +08:00
omap-aes.c crypto: omap-aes - fix error return code in omap_aes_probe() 2017-07-18 17:50:55 +08:00
omap-aes.h crypto: omap-aes - Add support for GCM mode 2017-06-10 12:04:19 +08:00
omap-crypto.c crypto: omap - add base support library for common routines 2017-06-10 12:04:15 +08:00
omap-crypto.h crypto: omap - add base support library for common routines 2017-06-10 12:04:15 +08:00
omap-des.c crypto: omap-des - fix error return code in omap_des_probe() 2017-07-18 17:50:55 +08:00
omap-sham.c crypto: omap-sham - fix memleak 2018-06-16 09:45:18 +02:00
padlock-aes.c crypto: padlock-aes - Fix Nano workaround data corruption 2018-08-06 16:20:51 +02:00
padlock-sha.c x86/fpu: Remove irq_ts_save() and irq_ts_restore() 2016-11-01 07:47:54 +01:00
picoxcell_crypto.c crypto: picoxcell - Remove spacc_is_compatible() wrapper function 2017-01-13 00:24:41 +08:00
picoxcell_crypto_regs.h crypto: picoxcell - add support for the picoxcell crypto engines 2011-02-21 22:42:40 +11:00
s5p-sss.c crypto: s5p-sss - Fix kernel Oops in AES-ECB mode 2018-02-25 11:08:04 +01:00
sahara.c crypto: sahara - constify platform_device_id 2017-08-22 14:54:53 +08:00
talitos.c crypto: talitos - fix IPsec cipher in length 2018-05-09 09:51:49 +02:00
talitos.h crypto: talitos - add new crypto modes 2015-12-04 22:29:56 +08:00