linux/drivers/crypto/caam
Horia Geantă 13cc6f48c7 crypto: caam/jr - fix ablkcipher_edesc pointer arithmetic
In some cases the zero-length hw_desc array at the end of
ablkcipher_edesc struct requires for 4B of tail padding.

Due to tail padding and the way pointers to S/G table and IV
are computed:
	edesc->sec4_sg = (void *)edesc + sizeof(struct ablkcipher_edesc) +
			 desc_bytes;
	iv = (u8 *)edesc->hw_desc + desc_bytes + sec4_sg_bytes;
first 4 bytes of IV are overwritten by S/G table.

Update computation of pointer to S/G table to rely on offset of hw_desc
member and not on sizeof() operator.

Cc: <stable@vger.kernel.org> # 4.13+
Fixes: 115957bb3e ("crypto: caam - fix IV DMA mapping and updating")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2018-09-21 13:04:46 +08:00
..
Kconfig crypto: caam - fix LS1021A support on ARMv7 multiplatform kernel 2017-09-20 17:42:42 +08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
caamalg.c crypto: caam/jr - fix ablkcipher_edesc pointer arithmetic 2018-09-21 13:04:46 +08:00
caamalg_desc.c crypto: caam - fix rfc4543 descriptors 2018-05-31 00:13:46 +08:00
caamalg_desc.h crypto: caam - prepare for gcm(aes) support over QI interface 2018-02-15 23:26:53 +08:00
caamalg_qi.c crypto: caam/qi - fix error path in xts setkey 2018-08-25 19:50:41 +08:00
caamhash.c crypto: ahash - remove useless setting of cra_type 2018-07-09 00:30:26 +08:00
caampkc.c crypto: caam - fix DMA mapping direction for RSA forms 2 & 3 2018-08-25 19:50:41 +08:00
caampkc.h crypto: caam - strip input zeros from RSA input buffer 2018-04-21 00:59:03 +08:00
caamrng.c crypto: caam - clean-up in caam_init_rng() 2017-07-18 18:16:07 +08:00
compat.h Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-11-14 10:52:09 -08:00
ctrl.c crypto: caam - fix MC firmware detection 2018-05-31 00:13:46 +08:00
ctrl.h crypto: caam - staticize caam_get_era() 2018-04-21 00:58:36 +08:00
desc.h crypto: caam - add Derived Key Protocol (DKP) support 2017-12-28 17:56:48 +11:00
desc_constr.h crypto: caam - add Derived Key Protocol (DKP) support 2017-12-28 17:56:48 +11:00
error.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
error.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
intern.h crypto: caam - fix MC firmware detection 2018-05-31 00:13:46 +08:00
jr.c crypto: caam/jr - fix descriptor DMA unmapping 2018-08-25 19:50:40 +08:00
jr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
key_gen.c crypto: caam - add Derived Key Protocol (DKP) support 2017-12-28 17:56:48 +11:00
key_gen.h crypto: caam - add Derived Key Protocol (DKP) support 2017-12-28 17:56:48 +11:00
pdb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pkc_desc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
qi.c crypto: caam/qi - fix warning in init_cgr() 2018-05-31 00:13:47 +08:00
qi.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
regs.h crypto: caam - allow retrieving 'era' from register 2018-04-21 00:58:37 +08:00
sg_sw_qm.h crypto: caam/qi - add ablkcipher and authenc algorithms 2017-03-24 22:02:59 +08:00
sg_sw_qm2.h staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl 2018-07-24 16:18:55 -05:00
sg_sw_sec4.h staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl 2018-07-24 16:18:55 -05:00