Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1460578ybm; Thu, 23 May 2019 01:10:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRVvk62qf73xw1fFLFshHgY0rSGd1jUZGKIQ2owSD58gRGgTDiM4VFlPtS8dElB7I09QMJ X-Received: by 2002:a62:1a93:: with SMTP id a141mr69778759pfa.72.1558599027640; Thu, 23 May 2019 01:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558599027; cv=none; d=google.com; s=arc-20160816; b=T71sxwiOBCy/LPjeKqmEk7mElJda8BJQQ4V0cqipgvp2OckmwkdzdByobiesB34ev+ OwXVqONg3XbCtAZlSSUPiDTBNfwaPIjRjG3Hg/DrEjsaJQnZAYvi7ReHefFFZ4qDf8yL IKObeRzAKnW1g7TlI+fWnIl89jdzLYav3MxdGN9aXTmM0Onu98Eo76IeTkVR9llAjmDI Zba+M1eaG5rst2DEsheCUHOp3IjC1Cgns51w/B5l63dmzblCXdLfZsUXkHbie1volItO jIsUOvuakzKlQUNi16R0XCzhCnUxMOCQ4M1GivRaZyWx3QS+Lzwlgg2wI0QuK9vtX5M1 pIdg== 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 :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=s7TW7SrGZyFu1JjCdwNDBFdcM4EAzwrJk58onsTZD0g=; b=CumyqEv7sNSloAcWz9WgvHWyaYizrL+DRQPcAvHp0cUodOmvwijaXf5Pt0oMhjwJnh sky1WrY3um9cqWX3nUHWFpySJiViie5PkHv43qiDM3gCtzTviK0SXk8BYiTXGbHMyJQd s3G4tXcyRiSmVBig8YZmH6ALyAty+hMTVp8G341dPzPcGQ6DdCr6n6YJlUI/EU5kvqw8 rag0z1YmXTcSr3hLwJW5lWcblTUjJv+9JxDw1IiAN7rw2Bofe3curcmWXxORF/IC2/m+ s2ePpJvyag6M+vWSs6uMtA9em7LcfwobE8+S7B9gQKAw289J1kSKRMMZeGaUbqTuzkRn 1Gzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=mGGvxHny; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 a9si28586808pgw.14.2019.05.23.01.10.06; Thu, 23 May 2019 01:10:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=selector2 header.b=mGGvxHny; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 S1726385AbfEWIIy (ORCPT + 99 others); Thu, 23 May 2019 04:08:54 -0400 Received: from mail-eopbgr40054.outbound.protection.outlook.com ([40.107.4.54]:27552 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726070AbfEWIIy (ORCPT ); Thu, 23 May 2019 04:08:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s7TW7SrGZyFu1JjCdwNDBFdcM4EAzwrJk58onsTZD0g=; b=mGGvxHnyjYxFd3dxTFWM7DJADIkjyO8kXDeyA/TQ5oFH2VQcJFfZ0NKdUQQv7oQIhhQbb/tILqB/wrn22Mm6OHk98zqISllbBaHgqWk6Q1iNGygBEKj3dWE/lmpctuGI9cl5T51/6tOFy1k+1C/eVVVLB3NoM8hyADIrGA+Ovc0= Received: from VI1PR04MB4445.eurprd04.prod.outlook.com (20.177.55.161) by VI1PR04MB5150.eurprd04.prod.outlook.com (20.177.50.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.15; Thu, 23 May 2019 08:08:50 +0000 Received: from VI1PR04MB4445.eurprd04.prod.outlook.com ([fe80::39fd:f3c3:46fc:f872]) by VI1PR04MB4445.eurprd04.prod.outlook.com ([fe80::39fd:f3c3:46fc:f872%7]) with mapi id 15.20.1922.018; Thu, 23 May 2019 08:08:50 +0000 From: Iuliana Prodan To: Herbert Xu CC: Horia Geanta , Aymen Sghaier , "David S. Miller" , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx Subject: Re: [PATCH v2 1/2] crypto: caam - fix pkcs1pad(rsa-caam, sha256) failure because of invalid input Thread-Topic: [PATCH v2 1/2] crypto: caam - fix pkcs1pad(rsa-caam, sha256) failure because of invalid input Thread-Index: AQHVCxD1/1xcZwH7eE+osRH9ZRl26A== Date: Thu, 23 May 2019 08:08:50 +0000 Message-ID: References: <1557919546-360-1-git-send-email-iuliana.prodan@nxp.com> <20190523061202.ic2vgimgzvvm6dzc@gondor.apana.org.au> 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=iuliana.prodan@nxp.com; x-originating-ip: [212.146.100.6] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cf0ff7c2-6cf7-49e6-1d45-08d6df55e3b4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:VI1PR04MB5150; x-ms-traffictypediagnostic: VI1PR04MB5150: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; x-forefront-prvs: 00462943DE x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(136003)(366004)(346002)(396003)(199004)(189003)(66066001)(52536014)(99286004)(8676002)(25786009)(55016002)(316002)(4744005)(478600001)(76116006)(229853002)(73956011)(7696005)(64756008)(66446008)(66476007)(66946007)(66556008)(33656002)(26005)(74316002)(76176011)(186003)(5660300002)(68736007)(6116002)(6916009)(3846002)(6506007)(102836004)(53546011)(7736002)(4326008)(6436002)(486006)(44832011)(2906002)(305945005)(71190400001)(6246003)(14454004)(71200400001)(53936002)(9686003)(81166006)(81156014)(476003)(86362001)(8936002)(54906003)(446003)(256004)(32563001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB5150;H:VI1PR04MB4445.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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: AZFoy4EQkloD8QRcbg92lvtDMtkHRhRg/iOCa9DeOqOmfVchKcIf4rnDuF4Vrew2lYGSNdrQKZoT7eDiOMojHFp/OGLPYzCz5PV0F7K9BFwdvtwtI4YTK4vPofAn6yBY1BWEapHZ2qLLbl+JG6pmf1/ucV8J3GDeZ7pwzIhitiO7tVgmAvSC2AHLYd5bbM9CB4upxo3dTKIBEP0Ct4x906YWxKBIdNSzWhTO52ZexeQfu97EFKqb5cRthHrsSfCzVpRc4zDIHAg7ZFyS3Aixlzmpoaxd9/z/AxLjFpcawmao4kkM2xf0Ae2TUfCGBk+/94/UjGUPAVEcI3lg1KXvgxBH+9axN6LvoydUmxpDyJ37TYBKFqc9HBpYMznCGjrHPIcPZWZbb1pWWjlvluCGjBj5kj1VGgmxnH8Bk3A0Csg= 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: cf0ff7c2-6cf7-49e6-1d45-08d6df55e3b4 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2019 08:08:50.3430 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iuliana.prodan@nxp.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5150 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 5/23/2019 9:12 AM, Herbert Xu wrote:=0A= > On Wed, May 15, 2019 at 02:25:45PM +0300, Iuliana Prodan wrote:=0A= >>=0A= >> @@ -1058,6 +1105,14 @@ static int __init caam_pkc_init(void)=0A= >> goto out_put_dev;=0A= >> }=0A= >> =0A= >> + /* allocate zero buffer, used for padding input */=0A= >> + zero_buffer =3D kzalloc(CAAM_RSA_MAX_INPUT_SIZE - 1, GFP_DMA |=0A= >> + GFP_KERNEL);=0A= >> + if (!zero_buffer) {=0A= >> + err =3D -ENOMEM;=0A= >> + goto out_put_dev;=0A= >> + }=0A= >> +=0A= >> err =3D crypto_register_akcipher(&caam_rsa);=0A= >> if (err)=0A= >> dev_warn(ctrldev, "%s alg registration failed\n",=0A= > =0A= > This patch does not apply on top of the caam patch-series from Horia.=0A= > You're also going to leak zero_buffer if crypto_register_akcipher=0A= > fails.=0A= > =0A= > Cheers,=0A= > =0A= =0A= I'll fix the conflicts and also the leak of zero_buffer if =0A= crypto_register_akcipher fails and send a new version.=0A= =0A= Regards,=0A= Iulia=0A=