Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1173860pxf; Fri, 2 Apr 2021 03:22:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrYtDdtXmZh7YuMz3/k2sEeHtoLGvfRMqxCItwzARU7lYIZ6te8z6FxpUk/NCi14GkMDAV X-Received: by 2002:a02:9985:: with SMTP id a5mr12134795jal.122.1617358970342; Fri, 02 Apr 2021 03:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617358970; cv=none; d=google.com; s=arc-20160816; b=ET+Q24gcXPZbyIy1bJZ822j3j/D5b/o0ZZ8eMv3HENjoHtFQ9AwXJpygHHslg8yKv4 MDgr139HxaUV7z/fxGyk3Pq68lQp3yb9VATFjmoCSyFVg6yGX5iALzWKxL/bBM2ZKWH5 FgmPjPaED1p0o6qm5iWpeEXOHis/6oSzygPEgt9AQizsiFB/J64bMbq5ecN68T3i1E3u 6AYF4Pd1n90Eq56NkY8WL1rKDgIWRd6xBHEhggn/KiGd3ClflNvNstwmxfgEWBunm2gG RcStyN3iEh6Xb1tmTW3uiDuGvihedT230RkJV0gVdHwaKl8cY3f+WfoQ2AjlzBMfVPD/ ARjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=YS2Bpt73SZ6WwhqXLRId7HHSRnWK5PL7GQ7b0weUdoI=; b=XkVO8sbHhWyoHqWb5H49xupBPD+WM7WFOovlZCAdq1+Bhy9WhGm4fQTzKoD/0hcopc HeYfTxOGF4K0VFxmn4kb42l1ZZaWGv8/zB/sDm8pFeB1vV0QuyWvFAPxKrtORgwm26Ue aTdVlpcdmIcGRvTzhfkOfXL4ggKkW47Kj34fbir8XxOz4+6OcdOTur0fZ0DhO7LmhHak A/BckshDnMzlKTEYl0ntmeUuUcawhCFecVwHf6kIzKEI/FXihbCxPewIUs9S1r3mn6f1 /AkYsUzsiqQturTn4bpa3Zbc1mgeMnWsitAuF86Q6exDuDZLzYeb9hxcnSmnUCPm+9ZB /H1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si7513854jak.86.2021.04.02.03.22.35; Fri, 02 Apr 2021 03:22:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbhDBKWf (ORCPT + 99 others); Fri, 2 Apr 2021 06:22:35 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:33872 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbhDBKWe (ORCPT ); Fri, 2 Apr 2021 06:22:34 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1lSGwZ-00041L-U9; Fri, 02 Apr 2021 21:22:25 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 02 Apr 2021 21:22:23 +1100 Date: Fri, 2 Apr 2021 21:22:23 +1100 From: Herbert Xu To: yumeng Cc: davem@davemloft.net, linux-crypto@vger.kernel.org, xuzaibo@huawei.com, wangzhou1@hisilicon.com, linux-kernel@vger.kernel.org, shenyang39@huawei.com Subject: Re: [PATCH] crypto: hisilicon/hpre - rsa key should not be empty Message-ID: <20210402102223.GA24978@gondor.apana.org.au> References: <1616739212-7751-1-git-send-email-yumeng18@huawei.com> <20210402071225.GA10423@gondor.apana.org.au> <7384e015-5514-d6b2-4215-beb1f4701adb@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7384e015-5514-d6b2-4215-beb1f4701adb@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Apr 02, 2021 at 06:16:16PM +0800, yumeng wrote: > > I think it is not a real bug, and soft fallback setkey can always catch the > error. > But our original intention was to make it don't go to 'xxx_set_pub_key' > when the key is null, and it can return an error earlier. > But maybe it is not good. It might make sense to check them twice if you were touching them directly, e.g., poking inside the key. However, it appears that your driver simply palms off the key to rsa_helper.c which should check the key/keylen too so I think there is no need for this patch for now. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt