linux-bl808/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
..
caamalg.c crypto: caam/jr - fix ablkcipher_edesc pointer arithmetic 2018-09-21 13:04:46 +08:00
caamalg_desc.c
caamalg_desc.h
caamalg_qi.c crypto: caam/qi - fix error path in xts setkey 2018-08-25 19:50:41 +08:00
caamhash.c
caampkc.c crypto: caam - fix DMA mapping direction for RSA forms 2 & 3 2018-08-25 19:50:41 +08:00
caampkc.h
caamrng.c
compat.h
ctrl.c
ctrl.h
desc.h
desc_constr.h
error.c
error.h
intern.h
jr.c
jr.h
Kconfig
key_gen.c
key_gen.h
Makefile
pdb.h
pkc_desc.c
qi.c
qi.h
regs.h
sg_sw_qm.h
sg_sw_qm2.h
sg_sw_sec4.h