lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 27 Aug 2018 14:09:19 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     "Martin K. Petersen" <martin.petersen@...cle.com>
Cc:     Jeff.Lien@....com, ard.biesheuvel@...aro.org,
        david.darrington@....com, hch@...radead.org, jeff.furlong@....com,
        linux-block@...r.kernel.org, linux-crypto@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
        tim.c.chen@...ux.intel.com
Subject: Re: [PATCH 1/4] crypto: Introduce notifier for new crypto algorithms

On Sat, Aug 25, 2018 at 10:40:03PM -0400, Martin K. Petersen wrote:
>
> diff --git a/crypto/algapi.c b/crypto/algapi.c
> index c0755cf4f53f..87abad3cc322 100644
> --- a/crypto/algapi.c
> +++ b/crypto/algapi.c
> @@ -361,15 +361,12 @@ static void crypto_wait_for_test(struct crypto_larval *larval)
>  	err = crypto_probing_notify(CRYPTO_MSG_ALG_REGISTER, larval->adult);
>  	if (err != NOTIFY_STOP) {
>  		if (WARN_ON(err != NOTIFY_DONE))
> -			goto out;
> +			return;
>  		crypto_alg_tested(larval->alg.cra_driver_name, 0);
>  	}
>  
>  	err = wait_for_completion_killable(&larval->completion);
>  	WARN_ON(err);
> -
> -out:
> -	crypto_larval_kill(&larval->alg);
>  }
>  
>  int crypto_register_alg(struct crypto_alg *alg)
> @@ -390,6 +387,8 @@ int crypto_register_alg(struct crypto_alg *alg)
>  		return PTR_ERR(larval);
>  
>  	crypto_wait_for_test(larval);
> +	crypto_probing_notify(CRYPTO_MSG_ALG_LOADED, larval);
> +	crypto_larval_kill(&larval->alg);

I see that you have moved the larval_kill call into the caller.
This is a problem because there are two callers to wait_for_test.

So it's probably best to leave it in wait_for_test and add the
notify there.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ