Re: [PATCH 1/3] staging: ccree: copy IV to DMAable memory

2017-11-01 Thread Dan Carpenter
On Tue, Oct 31, 2017 at 11:56:15AM +, Gilad Ben-Yossef wrote: > + > + /* The IV we are handed may be allocted from the stack so > + * we must copy it to a DMAable buffer before use. > + */ > + req_ctx->iv = kmalloc(ivsize, GFP_KERNEL); > + memcpy(req_ctx->iv, info, ivsize)

[PATCH 1/3] staging: ccree: copy IV to DMAable memory

2017-10-31 Thread Gilad Ben-Yossef
We are being passed an IV buffer from unknown origin, which may be stack allocated and thus not safe for DMA. Allocate a DMA safe buffer for the IV and use that instead. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 16 ++-- drivers/staging/ccree/ssi_cipher