[PATCH -next] crypto: ccp - Use kmemdup in ccp_copy_and_save_keypart()

2019-03-29 Thread YueHaibing
Use kmemdup rather than duplicating its implementation Signed-off-by: YueHaibing --- drivers/crypto/ccp/ccp-crypto-rsa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/ccp-crypto-rsa.c b/drivers/crypto/ccp/ccp-crypto-rsa.c index 0b8aab009e7b..841acdffbc

[PATCH] crypto: Use ___cacheline_aligned for aes data

2019-03-29 Thread Andi Kleen
From: Andi Kleen cacheline_aligned is a special section. It cannot be const at the same time because it's not read-only. It doesn't give any MMU protection. Mark it cacheline_aligned to not place it in a special section, but just align it in .rodata Cc: herb...@gondor.apana.org.au Suggested

[PATCH 1/2] crypto: scompress: return proper error code for allocation failure

2019-03-29 Thread Sebastian Andrzej Siewior
If scomp_acomp_comp_decomp() fails to allocate memory for the destination then we never copy back the data we compressed. It is probably best to return an error code instead 0 in case of failure. I haven't found any user that is using acomp_request_set_params() without the `dst' buffer so there is

[PATCH 2/2] crypto: scompress: Use per-CPU struct instead multiple variables

2019-03-29 Thread Sebastian Andrzej Siewior
Two per-CPU variables are allocated as pointer to per-CPU memory which then are used as scratch buffers. We could be smart about this and use instead a per-CPU struct which contains the pointers already and then we need to allocate just the scratch buffers. Add a lock to the struct. By doing so we