linux/drivers/crypto/caam
Steve Cornelius f78a4015ad crypto: caam - fix RNG buffer cache alignment
commit 412c98c1be upstream.

The hwrng output buffers (2) are cast inside of a a struct (caam_rng_ctx)
allocated in one DMA-tagged region. While the kernel's heap allocator
should place the overall struct on a cacheline aligned boundary, the 2
buffers contained within may not necessarily align. Consenquently, the ends
of unaligned buffers may not fully flush, and if so, stale data will be left
behind, resulting in small repeating patterns.

This fix aligns the buffers inside the struct.

Note that not all of the data inside caam_rng_ctx necessarily needs to be
DMA-tagged, only the buffers themselves require this. However, a fix would
incur the expense of error-handling bloat in the case of allocation failure.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2015-06-29 12:25:37 -07:00
..
caamalg.c crypto: caam - simplify and harden key parsing 2013-12-20 20:06:27 +08:00
caamhash.c crypto: caam - remove duplicated sg copy functions 2014-11-21 09:23:01 -08:00
caamrng.c crypto: caam - fix RNG buffer cache alignment 2015-06-29 12:25:37 -07:00
compat.h Revert "crypto: caam - add IPsec ESN support" 2013-03-21 17:36:03 +08:00
ctrl.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2013-11-23 16:18:25 -08:00
ctrl.h crypto: caam - ERA retrieval and printing for SEC device 2012-07-11 11:06:11 +08:00
desc.h crypto: caam - fix RNG4 AAI defines 2013-09-13 21:43:55 +10:00
desc_constr.h crypto: caam - Moved macro DESC_JOB_IO_LEN to desc_constr.h 2013-07-10 16:53:28 +10:00
error.c crypto: caam - add allocation failure handling in SPRINTFCAT macro 2014-06-07 10:28:27 -07:00
error.h crypto: caam - fix printk recursion for long error texts 2011-05-04 15:15:06 +10:00
intern.h crypto: caam - Modify the interface layers to use JR API's 2013-10-30 12:02:58 +08:00
jr.c crypto: caam - fix memleak in caam_jr module 2014-07-17 16:21:04 -07:00
jr.h crypto: caam - Add API's to allocate/free Job Rings 2013-10-30 12:02:57 +08:00
Kconfig crypto: caam - Add Platform driver for Job Ring 2013-10-30 12:02:57 +08:00
key_gen.c crypto: caam - fix missing dma unmap on error path 2014-11-21 09:23:00 -08:00
key_gen.h crypto: caam - change key gen functions to return signed int 2013-04-25 21:01:43 +08:00
Makefile crypto: caam - Add Platform driver for Job Ring 2013-10-30 12:02:57 +08:00
pdb.h crypto: caam - Add define for Adjust Output Frame Length in PDB 2013-05-28 15:37:08 +08:00
regs.h crypto: caam - enable instantiation of all RNG4 state handles 2013-09-13 21:43:56 +10:00
sg_sw_sec4.h crypto: caam - remove duplicated sg copy functions 2014-11-21 09:23:01 -08:00