public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Franzki <ifranzki@linux.ibm.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	Heiko Carstens <hca@linux.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, linux-s390@vger.kernel.org,
	Harald Freudenberger <freude@linux.ibm.com>,
	Holger Dengler <dengler@linux.ibm.com>
Subject: Re: [PATCH] crypto: s390/paes - Fix module aliases
Date: Wed, 18 Sep 2024 08:50:29 +0200	[thread overview]
Message-ID: <4c413338-808f-430c-bc03-624ac789cfff@linux.ibm.com> (raw)
In-Reply-To: <ZupQq2os75c_BFRz@gondor.apana.org.au>

On 18.09.2024 06:01, Herbert Xu wrote:
> On Tue, Sep 17, 2024 at 11:54:30AM +0200, Ingo Franzki wrote:
>>
>> I used 'make defconfig' on s390x, so nothing special: 
> 
> Thanks, it turns out to be an existing bug but it just happens
> to have worked.
> 
> ---8<---
> The paes_s390 module didn't declare the correct aliases for the
> algorithms that it registered.  Instead it declared an alias for
> the non-existent paes algorithm.
> 
> The Crypto API will eventually try to load the paes algorithm, to
> construct the cbc(paes) instance.  But because the module does not
> actually contain a "paes" algorithm, this will fail.
> 
> Previously this failure was hidden and the the cbc(paes) lookup will
> be retried.  This was fixed recently, thus exposing the buggy alias
> in paes_s390.
> 
> Replace the bogus paes alias with aliases for the actual algorithms.
> 
> Reported-by: Ingo Franzki <ifranzki@linux.ibm.com>
> Fixes: e7a4142b35ce ("crypto: api - Fix generic algorithm self-test races")
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> 
> diff --git a/arch/s390/crypto/paes_s390.c b/arch/s390/crypto/paes_s390.c
> index 99ea3f12c5d2..b8d9f385555d 100644
> --- a/arch/s390/crypto/paes_s390.c
> +++ b/arch/s390/crypto/paes_s390.c
> @@ -802,7 +802,10 @@ static int __init paes_s390_init(void)
>  module_init(paes_s390_init);
>  module_exit(paes_s390_fini);
>  
> -MODULE_ALIAS_CRYPTO("paes");
> +MODULE_ALIAS_CRYPTO("ecb(paes)");
> +MODULE_ALIAS_CRYPTO("cbc(paes)");
> +MODULE_ALIAS_CRYPTO("ctr(paes)");
> +MODULE_ALIAS_CRYPTO("xts(paes)");
>  
>  MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm with protected keys");
>  MODULE_LICENSE("GPL");

I can confirm that this solves the problem.
Thanks for identifying this!

Tested-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>

Trough which tree should we carry this patch forward? 
Through the crypto tree or the s390 tree? 
@Heiko @Harald @Herbert opinions?

-- 
Ingo Franzki
eMail: ifranzki@linux.ibm.com  
Tel: ++49 (0)7031-16-4648
Linux on IBM Z Development, Schoenaicher Str. 220, 71032 Boeblingen, Germany

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM DATA Privacy Statement: https://www.ibm.com/privacy/us/en/

  reply	other threads:[~2024-09-18  6:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-17  7:31 linux-next/crypto: Problem with loading paes_s390x kernel cipher since commit "crypto: api - Fix generic algorithm self-test races" Ingo Franzki
2024-09-17  9:29 ` Herbert Xu
2024-09-17  9:54   ` Ingo Franzki
2024-09-18  4:01     ` [PATCH] crypto: s390/paes - Fix module aliases Herbert Xu
2024-09-18  6:50       ` Ingo Franzki [this message]
2024-09-18  8:20         ` 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=4c413338-808f-430c-bc03-624ac789cfff@linux.ibm.com \
    --to=ifranzki@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=dengler@linux.ibm.com \
    --cc=freude@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-s390@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox