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:   Fri, 6 Mar 2020 11:12:22 -0500
From:   Daniel Jordan <daniel.m.jordan@...cle.com>
To:     Eric Biggers <ebiggers@...nel.org>,
        Corentin Labbe <clabbe.montjoie@...il.com>
Cc:     Daniel Jordan <daniel.m.jordan@...cle.com>,
        Robin Murphy <robin.murphy@....com>, mark.rutland@....com,
        jiangshanlai@...il.com, linux-kernel@...r.kernel.org,
        linux-crypto@...r.kernel.org, tj@...nel.org,
        Will Deacon <will@...nel.org>,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: WARNING: at kernel/workqueue.c:1473 __queue_work+0x3b8/0x3d0

On Tue, Mar 03, 2020 at 02:43:27PM -0800, Eric Biggers wrote:
> Probably the request_module() is coming from the registration-time crypto
> self-tests allocating the generic implementation of algorithm when an
> architecture-specific implementation is registered.  This occurs when
> CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y on Linux v5.2 and later.

Ok, I can confirm that if we get the debug output from one of Corentin's
boards.

> If this is causing problems we could do:
> 
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
> index ccb3d60729fc..d89791700b88 100644
> --- a/crypto/testmgr.c
> +++ b/crypto/testmgr.c
> @@ -1667,7 +1667,7 @@ static int test_hash_vs_generic_impl(const char *driver,
>  	if (strcmp(generic_driver, driver) == 0) /* Already the generic impl? */
>  		return 0;
>  
> -	generic_tfm = crypto_alloc_shash(generic_driver, 0, 0);
> +	generic_tfm = crypto_alloc_shash(generic_driver, 0, CRYPTO_NOLOAD);
>  	if (IS_ERR(generic_tfm)) {
>  		err = PTR_ERR(generic_tfm);
>  		if (err == -ENOENT) {
> @@ -2389,7 +2389,7 @@ static int test_aead_vs_generic_impl(struct aead_extra_tests_ctx *ctx)
>  	if (strcmp(generic_driver, driver) == 0) /* Already the generic impl? */
>  		return 0;
>  
> -	generic_tfm = crypto_alloc_aead(generic_driver, 0, 0);
> +	generic_tfm = crypto_alloc_aead(generic_driver, 0, CRYPTO_NOLOAD);
>  	if (IS_ERR(generic_tfm)) {
>  		err = PTR_ERR(generic_tfm);
>  		if (err == -ENOENT) {
> @@ -2993,7 +2993,7 @@ static int test_skcipher_vs_generic_impl(const char *driver,
>  	if (strcmp(generic_driver, driver) == 0) /* Already the generic impl? */
>  		return 0;
>  
> -	generic_tfm = crypto_alloc_skcipher(generic_driver, 0, 0);
> +	generic_tfm = crypto_alloc_skcipher(generic_driver, 0, CRYPTO_NOLOAD);
>  	if (IS_ERR(generic_tfm)) {
>  		err = PTR_ERR(generic_tfm);
>  		if (err == -ENOENT) {
> 
> 
> ... but that's not ideal, since it would mean that if someone builds all crypto
> algorithms as modules, then the comparison tests could be unnecessarily skipped.

We should try to avoid this then.

> But it is really always wrong to be calling request_module() from other
> module_init() functions?  The commit that added 'init_free_wq' was also
> introduced in v5.2; maybe that's the problem here?
> 
> 	commit 1a7b7d9220819afe79d1ec5d759fe4349bd2453e
> 	Author: Rick Edgecombe <rick.p.edgecombe@...el.com>
> 	Date:   Thu Apr 25 17:11:37 2019 -0700
> 
> 	    modules: Use vmalloc special flag

Yes, I don't see a reason init_free_wq has to be initialized that late.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ