Return-Path: Received: from mail-eopbgr10089.outbound.protection.outlook.com ([40.107.1.89]:24291 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726797AbfADPYu (ORCPT ); Fri, 4 Jan 2019 10:24:50 -0500 From: Horia Geanta To: Christophe Leroy , Herbert Xu , "David S. Miller" CC: "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "stable@vger.kernel.org" , "iommu@lists.linux-foundation.org" Subject: Re: [PATCH v3] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK Date: Fri, 4 Jan 2019 15:24:44 +0000 Message-ID: References: Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org List-ID: On 1/4/2019 5:17 PM, Horia Geanta wrote:=0A= > On 12/21/2018 10:07 AM, Christophe Leroy wrote:=0A= > [snip]=0A= >> IV cannot be on stack when CONFIG_VMAP_STACK is selected because the sta= ck=0A= >> cannot be DMA mapped anymore.=0A= >> This looks better, thanks.=0A= > =0A= >> This patch copies the IV into the extended descriptor when iv is not=0A= >> a valid linear address.=0A= >>=0A= > Though I am not sure the checks in place are enough.=0A= > =0A= >> Fixes: 4de9d0b547b9 ("crypto: talitos - Add ablkcipher algorithms")=0A= >> Cc: stable@vger.kernel.org=0A= >> Signed-off-by: Christophe Leroy =0A= >> ---=0A= >> v3: Using struct edesc buffer.=0A= >>=0A= >> v2: Using per-request context.=0A= > [snip]=0A= >> + if (ivsize && !virt_addr_valid(iv))=0A= >> + alloc_len +=3D ivsize;=0A= > [snip]=0A= >> =0A= >> + if (ivsize && !virt_addr_valid(iv))=0A= > A more precise condition would be (!is_vmalloc_addr || is_vmalloc_addr(iv= ))=0A= >=0A= Sorry for the typo, I meant:=0A= (!virt_addr_valid(iv) || is_vmalloc_addr(iv))=0A= =0A= > It matches the checks in debug_dma_map_single() helper, though I am not s= ure=0A= > they are enough to rule out all exceptions of DMA API.=0A=