On 1/4/2019 5:17 PM, Horia Geanta wrote:
On 12/21/2018 10:07 AM, Christophe Leroy wrote:Sorry for the typo, I meant:
[snip]
IV cannot be on stack when CONFIG_VMAP_STACK is selected because the stack
cannot be DMA mapped anymore.
This looks better, thanks.
This patch copies the IV into the extended descriptor when iv is notThough I am not sure the checks in place are enough.
a valid linear address.
Fixes: 4de9d0b547b9 ("crypto: talitos - Add ablkcipher algorithms")[snip]
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxx>
---
v3: Using struct edesc buffer.
v2: Using per-request context.
+ if (ivsize && !virt_addr_valid(iv))[snip]
+ alloc_len += ivsize;
+ if (ivsize && !virt_addr_valid(iv))A more precise condition would be (!is_vmalloc_addr || is_vmalloc_addr(iv))
(!virt_addr_valid(iv) || is_vmalloc_addr(iv))
It matches the checks in debug_dma_map_single() helper, though I am not sure
they are enough to rule out all exceptions of DMA API.