Thread (6 messages) flat view 6 messages, 4 authors, 2019-01-08

Re: [PATCH v3] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

From: Horia Geanta <horia.geanta@nxp.com>
Date: 2019-01-04 15:24:51
Also in: linux-crypto, linux-iommu, lkml, stable

On 1/4/2019 5:17 PM, Horia Geanta wrote:
On 12/21/2018 10:07 AM, Christophe Leroy wrote:
[snip]
quoted
IV cannot be on stack when CONFIG_VMAP_STACK is selected because the stack
cannot be DMA mapped anymore.
This looks better, thanks.
quoted
This patch copies the IV into the extended descriptor when iv is not
a valid linear address.
Though I am not sure the checks in place are enough.
quoted
Fixes: 4de9d0b547b9 ("crypto: talitos - Add ablkcipher algorithms")
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Leroy <redacted>
---
 v3: Using struct edesc buffer.

 v2: Using per-request context.
[snip]
quoted
+	if (ivsize && !virt_addr_valid(iv))
+		alloc_len += ivsize;
[snip]
quoted
 
+	if (ivsize && !virt_addr_valid(iv))
A more precise condition would be (!is_vmalloc_addr || is_vmalloc_addr(iv))
Sorry for the typo, I meant:
(!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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help