Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp916365imu; Fri, 4 Jan 2019 09:26:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Oy2D/PwiTira+/4M7DVJLyzHaytn0SCJ00Fsvzf1wvTNVqgExBxiffoYqCrYmiaIuR8FC X-Received: by 2002:a63:c24c:: with SMTP id l12mr2386988pgg.146.1546622765452; Fri, 04 Jan 2019 09:26:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546622765; cv=none; d=google.com; s=arc-20160816; b=BwoHzFGpChI/cu6hX2FSvBV9VuefDYTQv/Yu3cQRsv5cp/NNaDb4zmWl1VIP0S4Ox6 3cIts8d92TPgs5XpwFgQEyexXt1yDboRgvGUGLdTnQrwBAKOV78K4K/I7jQ6jWS+qPm0 +VJqIiti4nv6u374Mewebc7pZM0662skfyRXo0e3TGQYwsFomZi3AeJHg3PzNFsIFngv kxA4+utcKLnS0wfF8v/U1fLX4egeq5OyXPOGjAafasvxZ9zBTZ/4sQuSRiPV1dIt44ry FCOPAX+tSanOZmtYuKUz967aJ//Cx0oyHP7k0JSoAMX2ojhk/VcZekj24r63XcOGFl3p A2mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=dRAkauuwKhKRsyCvAGyydscEgrMcKGndbNeZuDPWp/o=; b=lNiumiQTTqPgTw+eUvy2WKscB2rKVu9yWEbM8iW7uGs4LplT472d/99XySWoysjfp3 f7CIjGqXrN4yodKY63uLLikRmxVV7b91uJKtnIG4b4AUNT7csDjxb6X0nRT2tVWTPbF3 3LjPsm0t0HrCJaXcEWaKDeUUAlHnxjKfrmi9ygvQDg6AWOZWVKHd+wc8mvMsuLP0lvuq /y9tJjPTle3O2lGLKNPGwZWJDa9gcXxyG3dsMfj+kILfbB6xi+LntHNtyOKpdQe0blsH H7fz7Y1skpyk7+4F9+4c3PIZLyUGPl4NX84j38A14RTk24nc7//2Nbx3UnB2xOx4xaMV +5nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=Q2fjgcys; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h75si57552483pfj.257.2019.01.04.09.25.49; Fri, 04 Jan 2019 09:26:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=Q2fjgcys; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727519AbfADPYu (ORCPT + 99 others); Fri, 4 Jan 2019 10:24:50 -0500 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dRAkauuwKhKRsyCvAGyydscEgrMcKGndbNeZuDPWp/o=; b=Q2fjgcysLFF06VTsMmK5UAVWIUfCpef33B8GUh82qprAbNsTKlXMzsqRSVuNBs5sd0cQ+w7lqRRwKJjBr3B3EeOWC298FGtQLN/RS+gATvyQRsgOYtev9lsCAYNhTOl/saWY64FCWThexo7GEwqrf1KhjlTGdPdZwbImAplNTWo= Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com (52.134.3.153) by VI1PR0402MB3583.eurprd04.prod.outlook.com (52.134.4.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Fri, 4 Jan 2019 15:24:44 +0000 Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::9c4e:17cb:deff:1c18]) by VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::9c4e:17cb:deff:1c18%5]) with mapi id 15.20.1471.021; Fri, 4 Jan 2019 15:24:44 +0000 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 Thread-Topic: [PATCH v3] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK Thread-Index: AQHUmQRIuiLMyqBCRUqtEmVYpQRHSQ== Date: Fri, 4 Jan 2019 15:24:44 +0000 Message-ID: References: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=horia.geanta@nxp.com; x-originating-ip: [192.88.166.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0402MB3583;6:m7qzugfOKoXqMcHn1fnVyBi7yuqP96X5rJcJnq8HTPJK5xhdgCB8CzpdKBj6sR4GYHamf2ucDjSf3C6zkG7cldD1at8qRuP6QpxEL+SOPsql/VclXkSfGSuc/Ea/jdrU5vgMMdgvflHm5zMMF5mxRgPAe7QOtDxHGYHyjWtWGWap2wmJMLnX5O8MOxYW2nsgwTmDpdKtZ+qyy7WTuZ+9qwjxoNyOAat38eTnUaK3lJmLVl4MrmFmjTbwIiaouDW/ULsiFt4wex8kubj9p6kczM24k9RFogUKHojZpKkh659kPKxvt/Ox+3PdMWNM63u7omUz5NiNUah6pKCCMnnUUjy1NXrywvBgJ2kcPkZ31SnWG0i2RXf4RVe+D/C4Ws4DLlDOJwmhp86UCjGRPG+E7i+QiMiTL6mNsFRVAZdJ2XSUXok8hDauNZI8ZlknsaVDHipK2DhdzutWW9xjQNAX9w==;5:4OFEDb1AVTKUl1nvDLP7W3pWNQxRtQtqMs/YoUED+XVcYNUzgaEmbxri++IuW3IUsw/QnhBjjrYCMbt0VRBTP2hng7hq1z8qAQAEgWFSf7hHfA+portR+lQbED2F3wCqy17bXmYkiMesTtw7GwHp0/HXNPxgoAuKewsEkIQoDto=;7:LTvDiuJmSVPOS9qC0MhXxvIkzH9d82mwO8Fh+enRT1IHWMvDstIqxt5SwIdGQQzzLo+4mDvmeUKj3ggLnchMeaSoiph6uzqbM/BLWdq9qzk98I4S4vv9uZy5VPjQqXZqO10jiz9pRXb8oiUUbAeDFQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: e749cfab-8e75-4a22-97d8-08d67258c167 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR0402MB3583; x-ms-traffictypediagnostic: VI1PR0402MB3583: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(3231475)(944501520)(52105112)(93006095)(93001095)(10201501046)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:VI1PR0402MB3583;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0402MB3583; x-forefront-prvs: 0907F58A24 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(136003)(366004)(396003)(376002)(39860400002)(189003)(199004)(106356001)(8676002)(575784001)(86362001)(476003)(8936002)(68736007)(446003)(81156014)(105586002)(93156006)(6436002)(54906003)(229853002)(81166006)(110136005)(99286004)(74316002)(316002)(71190400001)(71200400001)(7736002)(53936002)(33656002)(6246003)(9686003)(55016002)(3846002)(6116002)(5660300001)(97736004)(25786009)(256004)(14444005)(4326008)(14454004)(478600001)(26005)(305945005)(53546011)(6506007)(2906002)(44832011)(7696005)(186003)(102836004)(486006)(76176011)(66066001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0402MB3583;H:VI1PR0402MB3485.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: xncqkIBm9nKF2+IysfBcqBnQMAZ3Ot7y8IOTnRr4ayQD07Dbt9XbpkYKv9vYi8RLGehE95ULxDrOq7CmXr5kD3d4vL/couxduBa0hwiZmjKUvAwp9pwngJM/n5MQ0wh+3zC1hFGx/wUZ3x5lkeTdXnGvzFdgadXq7ZVb6mznpqIu6D84j3JjNwhVnjW/MGOXCrbR/Rxm+mlsnJlnUDrnxi+FhduNgaimVzSnR3jpuV1L+gIuLGV41J2sQHoQzb2wUw8HcmhfxduUU/5+9C0lB6IviRc9UpnbM4cSFO/ooZkFgfHxKCXIH5Knmm3g7jfT spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e749cfab-8e75-4a22-97d8-08d67258c167 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2019 15:24:44.5813 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3583 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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=