Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp352137pxj; Fri, 11 Jun 2021 00:24:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHE4Zq0bR3vJ5re1ja92N3FOX6pG3HF3g16s8And60fLxr+yYAMuKlbfY4JyRl3hnZ2+zu X-Received: by 2002:a05:6402:1d0f:: with SMTP id dg15mr2229815edb.137.1623396258476; Fri, 11 Jun 2021 00:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623396258; cv=none; d=google.com; s=arc-20160816; b=Pt5dkZbm1FrryrMeD2ugjSiVwo3tRCCD+re6vaTlFm5jNl0Xm/aemby3RTOaY0L3c7 qndKsSJ65XR235wt7/gUlajiegPuTp4tTCK/cXzcXM7DkqD4DuJK1Hl3VVYtkJ6mHeL5 nB4zUk9sczEJwms9AqCUt/xv8KckW0dUz3+jvzfLmnqepI1W8pQvIW7j4x3lCw5PyMhj KdimVm3G7hBTwrlDzB1rYNsQc4H5ZOwn8dfTKpoehsWQ30DZtbZPHMjSHjoJhn3Qo85+ X0Zco6FJ1SUMr62bnA4vtRkIodHTbMsRomsX/82yreqhblzVGQZ+SDqKCSBrjUrF63si ErOw== 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=e/VFmdfXMHb8wOrlK75V8xBpKM9le66yum29rVEEfzw=; b=U5mEWMLLlUBDY9BbTOc/RtrpCHRMJUZgZ8vhYapoWwKgbG7inBX1h0xzh5pG5ctC39 y0gdcQL6Fy5KMNWxSYIx0cSbfHFMiwD0K31zAVH+352qbEG2YRyBirdxCkhIVNNbjuAH LjwPvxS+OhWWcz2nv4owQ5sz70sWs7vBYkh7m4MEmwrKilMTaD1EBcL+Eeq9bHsb98bz b5nCClEcRQ+VYhHdpbryOOsQGJmuAyDKEiBXYMlyu2LV8PGlk0EwUydG+psB7BwY4TKY PsZZcTweI8hY+SNhYN5O4jStWJNHXPC9cfQr6gY8lE/kjV392FjMfvR9pOT54C7LSNJt kFgQ== 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 g12si4489618edp.364.2021.06.11.00.23.54; Fri, 11 Jun 2021 00:24:18 -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 S231400AbhFKHZM (ORCPT + 99 others); Fri, 11 Jun 2021 03:25:12 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:50554 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231350AbhFKHZM (ORCPT ); Fri, 11 Jun 2021 03:25:12 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtp (Exim 4.92 #5 (Debian)) id 1lrbVZ-0005Kl-Oy; Fri, 11 Jun 2021 15:23:13 +0800 Received: from herbert by gondobar with local (Exim 4.92) (envelope-from ) id 1lrbVY-0002MN-TA; Fri, 11 Jun 2021 15:23:12 +0800 Date: Fri, 11 Jun 2021 15:23:12 +0800 From: Herbert Xu To: Hangbin Liu Cc: linux-crypto@vger.kernel.org, "Jason A . Donenfeld" , netdev@vger.kernel.org Subject: Re: [PATCH] crypto: x86/curve25519 - fix cpu feature checking logic in mod_exit Message-ID: <20210611072312.GE23016@gondor.apana.org.au> References: <20210603055341.24473-1-liuhangbin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210603055341.24473-1-liuhangbin@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Jun 03, 2021 at 01:53:40AM -0400, Hangbin Liu wrote: > In curve25519_mod_init() the curve25519_alg will be registered only when > (X86_FEATURE_BMI2 && X86_FEATURE_ADX). But in curve25519_mod_exit() > it still checks (X86_FEATURE_BMI2 || X86_FEATURE_ADX) when do crypto > unregister. This will trigger a BUG_ON in crypto_unregister_alg() as > alg->cra_refcnt is 0 if the cpu only supports one of X86_FEATURE_BMI2 > and X86_FEATURE_ADX. > > Fixes: 07b586fe0662 ("crypto: x86/curve25519 - replace with formally verified implementation") > Signed-off-by: Hangbin Liu > --- > arch/x86/crypto/curve25519-x86_64.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt