linux/drivers/crypto
Christian Lamparter 7e92e1717e crypto: crypto4xx - fix cfb and ofb "overran dst buffer" issues
Currently, crypto4xx CFB and OFB AES ciphers are
failing testmgr's test vectors.

|cfb-aes-ppc4xx encryption overran dst buffer on test vector 3, cfg="in-place"
|ofb-aes-ppc4xx encryption overran dst buffer on test vector 1, cfg="in-place"

This is because of a very subtile "bug" in the hardware that
gets indirectly mentioned in 18.1.3.5 Encryption/Decryption
of the hardware spec:

the OFB and CFB modes for AES are listed there as operation
modes for >>> "Block ciphers" <<<. Which kind of makes sense,
but we would like them to be considered as stream ciphers just
like the CTR mode.

To workaround this issue and stop the hardware from causing
"overran dst buffer" on crypttexts that are not a multiple
of 16 (AES_BLOCK_SIZE), we force the driver to use the scatter
buffers as the go-between.

As a bonus this patch also kills redundant pd_uinfo->num_gd
and pd_uinfo->num_sd setters since the value has already been
set before.

Cc: stable@vger.kernel.org
Fixes: f2a13e7cba ("crypto: crypto4xx - enable AES RFC3686, ECB, CFB and OFB offloads")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-05-03 14:03:29 +08:00
..
amcc crypto: crypto4xx - fix cfb and ofb "overran dst buffer" issues 2019-05-03 14:03:29 +08:00
axis crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
bcm crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
caam crypto: caam/jr - update gcm detection logic 2019-04-25 15:38:12 +08:00
cavium crypto: cavium/nitrox - Fix HW family part name format 2019-04-25 15:38:12 +08:00
ccp crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
ccree crypto: ccree - handle tee fips error during power management resume 2019-04-25 15:38:16 +08:00
chelsio crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
hisilicon crypto: hisilicon - Forbid 2-key 3DES in FIPS mode 2019-04-18 22:15:00 +08:00
inside-secure crypto: inside-secure - Forbid 2-key 3DES in FIPS mode 2019-04-18 22:15:00 +08:00
marvell crypto: marvell - Forbid 2-key 3DES in FIPS mode 2019-04-18 22:15:00 +08:00
mediatek crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
nx crypto: nx - don't abuse shash MAY_SLEEP flag 2019-04-25 15:38:12 +08:00
qat crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
qce crypto: qce - Forbid 2-key 3DES in FIPS mode 2019-04-18 22:15:01 +08:00
rockchip crypto: rockchip - update IV buffer to contain the next IV 2019-04-18 22:15:04 +08:00
stm32 crypto: stm32 - Forbid 2-key 3DES in FIPS mode 2019-04-18 22:15:01 +08:00
sunxi-ss crypto: sun4i-ss - fallback when length is not multiple of blocksize 2019-04-25 15:38:13 +08:00
ux500 crypto: ux500 - use ccflags-y instead of CFLAGS_<basename>.o 2019-04-25 15:40:39 +08:00
virtio crypto: virtio - clean up indentation, replace spaces with tab 2019-01-11 14:16:56 +08:00
vmx crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
atmel-aes-regs.h
atmel-aes.c crypto: atmel - switch to SPDX license identifiers 2018-09-04 11:37:04 +08:00
atmel-authenc.h crypto: atmel - switch to SPDX license identifiers 2018-09-04 11:37:04 +08:00
atmel-ecc.c crypto: atmel - switch to SPDX license identifiers 2018-09-04 11:37:04 +08:00
atmel-ecc.h crypto: atmel - switch to SPDX license identifiers 2018-09-04 11:37:04 +08:00
atmel-sha-regs.h
atmel-sha.c crypto: atmel - switch to SPDX license identifiers 2018-09-04 11:37:04 +08:00
atmel-tdes-regs.h
atmel-tdes.c crypto: atmel - Forbid 2-key 3DES in FIPS mode 2019-04-18 22:14:59 +08:00
exynos-rng.c
geode-aes.c crypto: drop mask=CRYPTO_ALG_ASYNC from 'cipher' tfm allocations 2018-11-20 14:26:55 +08:00
geode-aes.h
hifn_795x.c crypto: hifn_795x - Forbid 2-key 3DES in FIPS mode 2019-04-18 22:15:00 +08:00
img-hash.c
ixp4xx_crypto.c crypto: ixp4xx - Forbid 2-key 3DES in FIPS mode 2019-04-18 22:15:00 +08:00
Kconfig crypto: mxc-scc - Remove broken driver 2019-04-16 09:03:08 +08:00
Makefile crypto: mxc-scc - Remove broken driver 2019-04-16 09:03:08 +08:00
mxs-dcp.c crypto: mxs-dcp - remove set but not used variable 'fini' 2019-04-18 22:14:58 +08:00
n2_asm.S
n2_core.c crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
n2_core.h
omap-aes-gcm.c
omap-aes.c crypto: skcipher - remove remnants of internal IV generators 2018-12-23 11:52:45 +08:00
omap-aes.h crypto: omap-aes - Remove VLA usage of skcipher 2018-09-28 12:46:09 +08:00
omap-crypto.c
omap-crypto.h
omap-des.c crypto: omap - Forbid 2-key 3DES in FIPS mode 2019-04-18 22:15:00 +08:00
omap-sham.c crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
padlock-aes.c crypto: padlock-aes - Fix Nano workaround data corruption 2018-07-20 13:47:42 +08:00
padlock-sha.c crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
picoxcell_crypto_regs.h
picoxcell_crypto.c crypto: picoxcell - Forbid 2-key 3DES in FIPS mode 2019-04-18 22:15:00 +08:00
qcom-rng.c crypto: qcom-rng - Add ACPI support 2018-07-27 19:04:32 +08:00
s5p-sss.c crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
sahara.c crypto: sahara - Convert IS_ENABLED uses to __is_defined 2019-04-18 22:14:58 +08:00
talitos.c crypto: talitos - Forbid 2-key 3DES in FIPS mode 2019-04-18 22:15:01 +08:00
talitos.h