From: Ingo Franzki <ifranzki@linux.ibm.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
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: linux-next/crypto: Problem with loading paes_s390x kernel cipher since commit "crypto: api - Fix generic algorithm self-test races"
Date: Tue, 17 Sep 2024 09:31:30 +0200 [thread overview]
Message-ID: <6399cdf3-3bf4-4623-8be6-cd8978d11770@linux.ibm.com> (raw)
Hi Herbert,
we noticed a failure on linux-next in our CI that came in within the last few days.
We do a relatively simple command to open a dm-crypt device using the s390x specific PAES kernel cipher:
# cryptsetup plainOpen --key-file /sys/devices/virtual/misc/pkey/protkey/protkey_aes_128 --key-size 640 --cipher paes-cbc-plain64 /dev/loop0 enc-loop
This fails when the paes_s390x kernel module has not yet been loaded with the following:
device-mapper: reload ioctl on enc-loop (251:23) failed: No such file or directory
and the following on syslog:
kernel: device-mapper: table: 251:23: crypt: Error allocating crypto tfm (-ENOENT)
kernel: device-mapper: ioctl: error adding target to table
After that, the paes_s390x kernel module has been loaded, all self-tests have passed, and retrying the same command works fine.
So the problem only happens when dm-crypt is requesting the paes cipher, and it is not yet available.
This does trigger the paes_s390x kernel module to be loaded (it has an MODULE_ALIAS_CRYPTO("paes") included), but allocating the tfm fails anyway.
I can easily trigger the problem again by removing the paes_s390x kernel module via rmmod. After that the above command fails again.
I looked at the recent commits for the crypto sub-directory and reverted some of them to see if it makes a difference.
Reverting "crypto: testmgr - Hide ENOENT errors" (4eded6d14f5b7bb857b68872970a40cf3105c015) does not make a difference.
When reverting "crypto: algboss - Pass instance creation error up" (795f85fca229a88543a0a706039f901106bf11c1) it still fails, but it behaves differently.
It now times out after a while instead of failing right away:
# cryptsetup plainOpen --key-file /sys/devices/virtual/misc/pkey/protkey/protkey_aes_128 --key-size 640 --cipher paes-cbc-plain64 /dev/loop0 enc-loop
device-mapper: reload ioctl on enc-loop (251:0) failed: Connection timed out
Syslog:
kernel: device-mapper: table: 251:0: crypt: Error allocating crypto tfm (-ETIMEDOUT)
kernel: device-mapper: ioctl: error adding target to table
Finally, when I also revert "crypto: api - Fix generic algorithm self-test races" (e7a4142b35ce489fc8908d75596c51549711ade0) it starts to work again.
Not sure if the paes_s390x kernel module is doing something special which makes it fail with your changes, or what else is causing this.
Anyway, this looks like a regression caused by these recent commits.
Kind regards,
Ingo
--
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/
next reply other threads:[~2024-09-17 7:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-17 7:31 Ingo Franzki [this message]
2024-09-17 9:29 ` linux-next/crypto: Problem with loading paes_s390x kernel cipher since commit "crypto: api - Fix generic algorithm self-test races" 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
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=6399cdf3-3bf4-4623-8be6-cd8978d11770@linux.ibm.com \
--to=ifranzki@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=dengler@linux.ibm.com \
--cc=freude@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