android_kernel_sony_sdm845/drivers/crypto
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ard Biesheuvel 7b930def8e 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: 854b06f76879 ("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.9 ]
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-04 09:33:30 +02:00
..
amcc crypto: crypto4xx - fix a potential double free in ppc4xx_trng_probe 2019-08-04 09:33:26 +02:00
caam crypto: caam - limit output IV to CBC to work around CTR mode DMA issue 2019-08-04 09:33:30 +02:00
ccp crypto: ccp - Validate the the error value used to index error messages 2019-08-04 09:33:30 +02:00
chelsio crypto: chcr - Check device is allocated before use 2017-02-14 15:25:32 -08:00
marvell crypto: marvell - Copy IVDIG before launching partial DMA ahash requests 2017-11-30 08:39:14 +00:00
nx crypto: nx - off by one bug in nx_of_update_msc() 2016-07-19 12:01:47 +08:00
qat crypto: qat - Fix KASAN stack-out-of-bounds bug in adf_probe() 2018-10-10 08:53:23 +02:00
qce crypto: qce - Use skcipher for fallback 2016-07-01 23:45:09 +08:00
rockchip crypto: rockchip - use devm_add_action_or_reset() 2016-08-24 21:07:11 +08:00
sunxi-ss crypto: sun4i-ss - Fix invalid calculation of hash end 2019-05-31 06:48:16 -07:00
ux500 crypto: ux500 - Use proper enum in hash_set_dma_transfer 2019-02-12 19:44:58 +01:00
vmx crypto: vmx - ghash: do nosimd fallback manually 2019-06-11 12:22:35 +02:00
atmel-aes-regs.h crypto: atmel-aes - add support to GCM mode 2015-12-23 18:19:58 +08:00
atmel-aes.c Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-03-17 11:22:54 -07:00
atmel-sha-regs.h crypto: atmel-sha - fix context switches 2016-01-25 22:42:07 +08:00
atmel-sha.c crypto: atmel - only treat EBUSY as transient if backlog 2017-07-21 07:42:23 +02:00
atmel-tdes-regs.h
atmel-tdes.c crypto: atmel - fix checks of error code returned by devm_ioremap_resource() 2016-03-11 21:19:19 +08:00
bfin_crc.c crypto: hash - annotate algorithms taking optional key 2018-02-25 11:05:43 +01:00
bfin_crc.h
geode-aes.c
geode-aes.h
hifn_795x.c crypto: squash lines for simple wrapper functions 2016-09-13 20:27:26 +08:00
img-hash.c crypto: img-hash - Fix set_reqsize call 2016-08-09 18:47:23 +08:00
ixp4xx_crypto.c crypto: ixp4xx - Fix error handling path in 'aead_perform()' 2017-08-24 17:12:18 -07:00
Kconfig Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-10-10 14:04:16 -07:00
Makefile crypto: Added Chelsio Menu to the Kconfig file 2016-08-19 00:00:37 -07:00
mv_cesa.c crypto: mv_cesa - remove NO_IRQ reference 2016-09-07 21:08:32 +08:00
mv_cesa.h
mxc-scc.c crypto: mxc-scc - check clk_prepare_enable() error 2016-08-24 21:04:50 +08:00
mxs-dcp.c crypto: mxs-dcp - Fix wait logic on chan threads 2018-10-10 08:53:23 +02:00
n2_asm.S
n2_core.c crypto: n2 - cure use after free 2018-01-10 09:29:51 +01:00
n2_core.h
omap-aes.c crypto: omap-aes - fix error return code in omap_aes_probe() 2016-09-22 18:27:35 +08:00
omap-des.c crypto: omap-des - fix error return code in omap_des_probe() 2016-09-22 18:27:34 +08:00
omap-sham.c crypto: omap-sham - fix memleak 2018-06-16 09:52:35 +02:00
padlock-aes.c crypto: padlock-aes - Fix Nano workaround data corruption 2018-08-06 16:23:04 +02:00
padlock-sha.c x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros 2015-12-19 11:49:55 +01:00
picoxcell_crypto.c crypto: picoxcell - Use skcipher for fallback 2016-07-01 23:45:09 +08:00
picoxcell_crypto_regs.h
s5p-sss.c crypto: s5p-sss - Fix kernel Oops in AES-ECB mode 2018-02-25 11:05:56 +01:00
sahara.c crypto: sharah - Unregister correct algorithms for SAHARA 3 2018-09-26 08:36:34 +02:00
talitos.c crypto: talitos - Align SEC1 accesses to 32 bits boundaries. 2019-08-04 09:33:17 +02:00
talitos.h crypto: talitos - add new crypto modes 2015-12-04 22:29:56 +08:00