All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Simo Sorce <ssorce@redhat.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Biggers <ebiggers@kernel.org>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	kernel@pengutronix.de, Ard Biesheuvel <ardb@kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Vladis Dronov <vdronov@redhat.com>
Subject: Re: [PATCH] crypto: arm/aes-neonbs-cbc - Select generic cbc and aes
Date: Thu, 17 Mar 2022 08:11:51 +0100	[thread overview]
Message-ID: <20220317071151.ekr757ggancxp7wj@pengutronix.de> (raw)
In-Reply-To: <YjJq0RLIHvN7YWaT@gondor.apana.org.au>

[-- Attachment #1: Type: text/plain, Size: 2759 bytes --]

Hello Herbert,

On Thu, Mar 17, 2022 at 10:55:13AM +1200, Herbert Xu wrote:
> On Wed, Mar 16, 2022 at 05:37:19PM +0100, Uwe Kleine-König wrote:
> >
> > # CONFIG_CRYPTO_CBC is not set
> 
> This was the issue.  The failure occurs on registering __cbc_aes
> and the reason is that the neonbs cbc-aes requirs a fallback which
> isn't available due to CBC being disabled.
> 
> I have no idea why this started occurring only with the testmgr
> change though as this should have been fatal all along.

Yesterday I wondered about that, too. I didn't check, but I guess
00b99ad2bac2 was introduced between the testmgr regression and its fix
and the failure looks similar enough for me to not having noticed the
difference? Or my config somehow changed somewhere there (though I used
the same defconfig in each bisection step).

> ---8<---
> The algorithm __cbc-aes-neonbs requires a fallback so we need
> to select the config options for them or otherwise it will fail
> to register on boot-up.
> 
> Fixes: 00b99ad2bac2 ("crypto: arm/aes-neonbs - Use generic cbc...")
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> 
> diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig
> index 2b575792363e..e4dba5461cb3 100644
> --- a/arch/arm/crypto/Kconfig
> +++ b/arch/arm/crypto/Kconfig
> @@ -102,6 +102,8 @@ config CRYPTO_AES_ARM_BS
>  	depends on KERNEL_MODE_NEON
>  	select CRYPTO_SKCIPHER
>  	select CRYPTO_LIB_AES
> +	select CRYPTO_AES
> +	select CRYPTO_CBC
>  	select CRYPTO_SIMD
>  	help
>  	  Use a faster and more secure NEON based implementation of AES in CBC,

I tested your change and that indeed fixes booting for me. Thanks!
However I think there are two problems involved here, and you only fix
one of them with your patch.  Your change makes
simd_skcipher_create_compat() succeed, but aes_init() still has a broken
error handling. So if I do

diff --git a/arch/arm/crypto/aes-neonbs-glue.c b/arch/arm/crypto/aes-neonbs-glue.c
index 5c6cd3c63cbc..ee9812ee33b7 100644
--- a/arch/arm/crypto/aes-neonbs-glue.c
+++ b/arch/arm/crypto/aes-neonbs-glue.c
@@ -546,6 +546,11 @@ static int __init aes_init(void)
 		algname = aes_algs[i].base.cra_name + 2;
 		drvname = aes_algs[i].base.cra_driver_name + 2;
 		basename = aes_algs[i].base.cra_driver_name;
+		if (i == 1) {
+			/* simulate a problem to test the error path */
+			err = -ENOENT;
+			goto unregister_simds;
+		}
 		simd = simd_skcipher_create_compat(algname, drvname, basename);
 		err = PTR_ERR(simd);
 		if (IS_ERR(simd))

the BUG is back.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-03-17  7:12 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  7:12 [PATCH] crypto: api - Fix built-in testing dependency failures Herbert Xu
2021-09-13 18:16 ` Eric Biggers
2021-09-14  3:28   ` Herbert Xu
2021-09-17  0:26 ` [v2 PATCH] " Herbert Xu
2021-09-28 18:32   ` Nathan Chancellor
2021-10-01  5:50     ` Herbert Xu
2021-10-01 10:58       ` Naresh Kamboju
2021-10-01 10:58         ` Naresh Kamboju
2021-10-01 18:01       ` Nathan Chancellor
2021-10-03  0:28         ` Herbert Xu
2021-10-06  2:33           ` Nathan Chancellor
2021-10-19 13:28             ` [PATCH] crypto: api - Do not create test larvals if manager is disabled Herbert Xu
2021-11-02 15:41               ` Geert Uytterhoeven
2021-11-04  7:28                 ` Damien Le Moal
2021-11-04  7:58                   ` Geert Uytterhoeven
2021-11-04  8:05                     ` Damien Le Moal
2021-11-04 12:16                     ` Herbert Xu
2021-11-04 13:11                       ` Geert Uytterhoeven
2021-11-04 13:30                         ` Herbert Xu
2021-11-04 15:18                           ` Ido Schimmel
2021-11-05  7:26                             ` crypto: api - Fix boot-up crash when crypto " Herbert Xu
2021-11-05 14:33                               ` Ido Schimmel
2021-11-05 18:00                               ` Geert Uytterhoeven
2021-10-26 16:33   ` [v2 PATCH] crypto: api - Fix built-in testing dependency failures Guenter Roeck
2021-10-27  2:59     ` Herbert Xu
2021-10-27  3:48       ` Guenter Roeck
2021-11-06  3:47     ` Herbert Xu
2021-11-06 14:55       ` Guenter Roeck
2021-12-22 10:22         ` Uwe Kleine-König
2021-12-22 10:37           ` Uwe Kleine-König
2021-12-29  2:05           ` Herbert Xu
2021-12-29 11:05             ` Uwe Kleine-König
2022-03-16  1:10               ` Herbert Xu
2022-03-16 16:37                 ` Uwe Kleine-König
2022-03-16 21:44                   ` Uwe Kleine-König
2022-03-16 22:38                     ` Herbert Xu
2022-03-16 22:55                   ` [PATCH] crypto: arm/aes-neonbs-cbc - Select generic cbc and aes Herbert Xu
2022-03-17  7:11                     ` Uwe Kleine-König [this message]
2022-03-17  9:16                     ` Philipp Zabel
2022-03-17 22:15                       ` 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=20220317071151.ekr757ggancxp7wj@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=ardb@kernel.org \
    --cc=davem@davemloft.net \
    --cc=ebiggers@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=kernel@pengutronix.de \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=p.zabel@pengutronix.de \
    --cc=ssorce@redhat.com \
    --cc=vdronov@redhat.com \
    /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.