Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1366966ybm; Wed, 22 May 2019 23:13:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzntfsS45Xm3jsToSMDwYoPQKnXzDp9h+fNIxRJKKmmSI7a3iYMyBC7Iap/5s5P8u/wQhP7 X-Received: by 2002:a62:1c06:: with SMTP id c6mr18933159pfc.168.1558592018336; Wed, 22 May 2019 23:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558592018; cv=none; d=google.com; s=arc-20160816; b=I74SvvfDM/C3gFnDJKcU4VqwZZwhSVXYgk7x6qm/KkVAft2czSGuhhXgvzKWxEVRIc IRF4IjrXSf3RfICB7CtUN/A9nLgI3re5u6tJ/DWCsLRjhdtFs4J58BARf/GBGBKPPwQD /9wLCciwF/XvQsSw5M8TQUQZQ66b7ZkeeKVJJoFma5gqn8m3YMn6zgAZeqp4Rgo9uAIm W9Zzk8IBPYFetDoPBQDXyY0p+TI+BKFmsilHyVUUKK8L9vcAh1wpR7r3WKGxCyI5ZdnR xMuG0lTo4ZmsGm++I2eGiVzwD5Uur+nbfjVFvVL+4il2NB31HvaPwOf+un9/l9wMS5c1 4fEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5cQxFxcyzIv2RHQNvXt6cSnFaxT1ATpuXGEylz5zJVU=; b=SE0lNthOQ95ak6MTkIFDurk5xZ09/idjCTp2ga/GZGSVvT+fe5yh0AJGy/tblOL2E4 frRg1yrzMSE5oUr0FXxtv4ipuaagDI4R8cNQXV/UjFb8vFzDIxmTqk3XyN5eDHnVx9f7 //st50/0kwktJM8W5mE0nIR5pERuLfFsKPr6kyTL3YE5XZAUvNyIWGpSxopa3MW37LYL 8pKj4fcMtqzA38mACrWnO8zsfxF/rxnrzj6Cfk5kDW9ARZ62dNXNBhIyay26PI9g5H9A /TigIOgtpM5/1igDeN4iMwDRfjFLtRPeE67x0VqeCf1Irvw3ovhRaFzBU+oZRMJJ7jiE M2gw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q204si2322221pgq.470.2019.05.22.23.13.16; Wed, 22 May 2019 23:13:38 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726070AbfEWGMG (ORCPT + 99 others); Thu, 23 May 2019 02:12:06 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:47428 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725873AbfEWGMG (ORCPT ); Thu, 23 May 2019 02:12:06 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hTgxQ-0001Dr-VE; Thu, 23 May 2019 14:12:05 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hTgxO-0001EP-Sx; Thu, 23 May 2019 14:12:02 +0800 Date: Thu, 23 May 2019 14:12:02 +0800 From: Herbert Xu To: Iuliana Prodan Cc: Horia Geanta , Aymen Sghaier , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx Subject: Re: [PATCH v2 1/2] crypto: caam - fix pkcs1pad(rsa-caam, sha256) failure because of invalid input Message-ID: <20190523061202.ic2vgimgzvvm6dzc@gondor.apana.org.au> References: <1557919546-360-1-git-send-email-iuliana.prodan@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1557919546-360-1-git-send-email-iuliana.prodan@nxp.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, May 15, 2019 at 02:25:45PM +0300, Iuliana Prodan wrote: > > @@ -1058,6 +1105,14 @@ static int __init caam_pkc_init(void) > goto out_put_dev; > } > > + /* allocate zero buffer, used for padding input */ > + zero_buffer = kzalloc(CAAM_RSA_MAX_INPUT_SIZE - 1, GFP_DMA | > + GFP_KERNEL); > + if (!zero_buffer) { > + err = -ENOMEM; > + goto out_put_dev; > + } > + > err = crypto_register_akcipher(&caam_rsa); > if (err) > dev_warn(ctrldev, "%s alg registration failed\n", This patch does not apply on top of the caam patch-series from Horia. You're also going to leak zero_buffer if crypto_register_akcipher fails. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt