kernel-fxtec-pro1x/drivers/crypto
Ard Biesheuvel ef5c2e165a crypto: caam - limit output IV to CBC to work around CTR mode DMA issue
commit ed527b13d800dd515a9e6c582f0a73eca65b2e1b upstream.

The CAAM driver currently violates an undocumented and slightly
controversial requirement imposed by the crypto stack that a buffer
referred to by the request structure via its virtual address may not
be modified while any scatterlists passed via the same request
structure are mapped for inbound DMA.

This may result in errors like

  alg: aead: decryption failed on test 1 for gcm_base(ctr-aes-caam,ghash-generic): ret=74
  alg: aead: Failed to load transform for gcm(aes): -2

on non-cache coherent systems, due to the fact that the GCM driver
passes an IV buffer by virtual address which shares a cacheline with
the auth_tag buffer passed via a scatterlist, resulting in corruption
of the auth_tag when the IV is updated while the DMA mapping is live.

Since the IV that is returned to the caller is only valid for CBC mode,
and given that the in-kernel users of CBC (such as CTS) don't trigger the
same issue as the GCM driver, let's just disable the output IV generation
for all modes except CBC for the time being.

Fixes: 854b06f768 ("crypto: caam - properly set IV after {en,de}crypt")
Cc: Horia Geanta <horia.geanta@nxp.com>
Cc: Iuliana Prodan <iuliana.prodan@nxp.com>
Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ Horia: backported to 4.14, 4.19 ]
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-26 09:14:29 +02:00
..
amcc crypto: crypto4xx - fix a potential double free in ppc4xx_trng_probe 2019-07-26 09:14:20 +02:00
axis crypto: axis - fix for recursive locking from bottom half 2019-04-20 09:16:04 +02:00
bcm
caam crypto: caam - limit output IV to CBC to work around CTR mode DMA issue 2019-07-26 09:14:29 +02:00
cavium crypto: cavium/zip - fix collision with generic cra_driver_name 2019-04-05 22:33:01 +02:00
ccp crypto: ccp/gcm - use const time tag comparison. 2019-07-26 09:14:20 +02:00
ccree crypto: ccree - handle tee fips error during power management resume 2019-05-22 07:37:40 +02:00
chelsio
hisilicon
inside-secure crypto: inside-secure - do not rely on the hardware last bit for result descriptors 2019-07-26 09:14:04 +02:00
marvell
mediatek
nx crypto/NX: Set receive window credits to max number of CRBs in RxFIFO 2019-07-21 09:03:16 +02:00
qat
qce
rockchip crypto: rockchip - update IV buffer to contain the next IV 2019-05-22 07:37:37 +02:00
stm32
sunxi-ss crypto: sun4i-ss - Fix invalid calculation of hash end 2019-05-31 06:46:15 -07:00
ux500
virtio
vmx crypto: vmx - ghash: do nosimd fallback manually 2019-06-04 08:02:34 +02:00
atmel-aes-regs.h
atmel-aes.c
atmel-authenc.h
atmel-ecc.c
atmel-ecc.h
atmel-sha-regs.h
atmel-sha.c
atmel-tdes-regs.h
atmel-tdes.c
exynos-rng.c
geode-aes.c
geode-aes.h
hifn_795x.c
img-hash.c
ixp4xx_crypto.c
Kconfig
Makefile
mxc-scc.c
mxs-dcp.c
n2_asm.S
n2_core.c
n2_core.h
omap-aes-gcm.c
omap-aes.c
omap-aes.h
omap-crypto.c
omap-crypto.h
omap-des.c
omap-sham.c
padlock-aes.c
padlock-sha.c
picoxcell_crypto.c
picoxcell_crypto_regs.h
qcom-rng.c
s5p-sss.c
sahara.c
talitos.c crypto: talitos - Align SEC1 accesses to 32 bits boundaries. 2019-07-26 09:14:03 +02:00
talitos.h crypto: talitos - move struct talitos_edesc into talitos.h 2019-07-21 09:03:15 +02:00