All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: linux-crypto@vger.kernel.org,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] crypto: x86/curve25519 - fix cpu feature checking logic in mod_exit
Date: Fri, 11 Jun 2021 15:23:12 +0800	[thread overview]
Message-ID: <20210611072312.GE23016@gondor.apana.org.au> (raw)
In-Reply-To: <20210603055341.24473-1-liuhangbin@gmail.com>

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 <liuhangbin@gmail.com>
> ---
>  arch/x86/crypto/curve25519-x86_64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  parent reply	other threads:[~2021-06-11  7:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03  5:53 [PATCH] crypto: x86/curve25519 - fix cpu feature checking logic in mod_exit Hangbin Liu
2021-06-03 10:24 ` Jason A. Donenfeld
2021-06-03 14:06   ` Hangbin Liu
2021-06-11  7:23 ` Herbert Xu [this message]
2021-06-11 10:07   ` Jason A. Donenfeld
2021-06-11 12:46     ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210611072312.GE23016@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=Jason@zx2c4.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.