From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9DA1C433B4 for ; Fri, 2 Apr 2021 10:22:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD46561057 for ; Fri, 2 Apr 2021 10:22:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234389AbhDBKWg (ORCPT ); Fri, 2 Apr 2021 06:22:36 -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-kernel@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