linux-next/crypto: Problem with loading paes_s390x kernel cipher since commit "crypto: api - Fix generic algorithm self-test races"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx  
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/





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux