Bug 1217880

Summary: [SLE-Micro:Base-RT-encrypted] device-mapper: reload ioctl on luksRoot (254:0) failed
Product: [openSUSE] PUBLIC SUSE Linux Enterprise Micro 6.0 Reporter: Giacomo Leidi <giacomo.leidi>
Component: Image-based InstallationAssignee: Kernel Bugs <kernel-bugs>
Status: RESOLVED FIXED QA Contact: Jose Lausuch <jalausuch>
Severity: Normal    
Priority: P3 - Medium CC: fvogt, giacomo.leidi, gyribeiro, jsrain, mgorman, prokop.vlasin
Version: unspecified   
Target Milestone: Beta 2   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: SLE-Micro:Base-RT-encrypted.log

Description Giacomo Leidi 2023-12-07 13:03:48 UTC
Created attachment 871197 [details]
SLE-Micro:Base-RT-encrypted.log

Hello the x86_64 SLE-Micro:Base-RT-encrypted image fails to build due to the following:


[  195s] [ INFO    ]: 11:14:18 | --> Creating LUKS map
[  195s] [ DEBUG   ]: 11:14:18 | EXEC: [cryptsetup -q --key-file /var/tmp/kiwi_i6yxwrb7 --type luks2 --pbkdf pbkdf2 luksFormat /dev/loop0p3]
[  200s] [ DEBUG   ]: 11:14:23 | EXEC: [cryptsetup --key-file /var/tmp/kiwi_i6yxwrb7 luksAddKey /dev/loop0p3 /usr/src/packages/KIWI-oem/build/image-root/root/.root.keyfile]
[  209s] [ DEBUG   ]: 11:14:31 | EXEC: [cryptsetup --key-file /var/tmp/kiwi_i6yxwrb7 luksOpen /dev/loop0p3 luksRoot]
[  211s] [  206.120504][ T5701] device-mapper: table: 254:0: crypt: Error allocating crypto tfm (-ENOENT)
[  211s] [  206.120755][ T5701] device-mapper: ioctl: error adding target to table
[  211s] [ DEBUG   ]: 11:14:34 | EXEC: Failed with stderr: device-mapper: reload ioctl on luksRoot (254:0) failed: No such file or directory
[  211s] , stdout: (no output on stdout)
[  211s] [ ERROR   ]: 11:14:34 | KiwiCommandError: cryptsetup: stderr: device-mapper: reload ioctl on luksRoot (254:0) failed: No such file or directory
[  211s] , stdout: (no output on stdout)


This is probably something related to the RT kernel, I'm attaching the full log.

Could you please have a look?

Thank you,


[0]:
Comment 1 Giacomo Leidi 2023-12-07 13:08:02 UTC
i forgot to attach the link [0]


[0]: https://build.suse.de/build/SUSE:ALP:Products:Marble:6.0/images/x86_64/SLE-Micro:Base-RT-encrypted/_log
Comment 3 Mel Gorman 2023-12-07 15:30:11 UTC
(In reply to Giacomo Leidi from comment #0)
> Created attachment 871197 [details]
> SLE-Micro:Base-RT-encrypted.log
> 
> Hello the x86_64 SLE-Micro:Base-RT-encrypted image fails to build due to the
> following:
> 
> 
> [  195s] [ INFO    ]: 11:14:18 | --> Creating LUKS map
> [  195s] [ DEBUG   ]: 11:14:18 | EXEC: [cryptsetup -q --key-file
> /var/tmp/kiwi_i6yxwrb7 --type luks2 --pbkdf pbkdf2 luksFormat /dev/loop0p3]
> [  200s] [ DEBUG   ]: 11:14:23 | EXEC: [cryptsetup --key-file
> /var/tmp/kiwi_i6yxwrb7 luksAddKey /dev/loop0p3
> /usr/src/packages/KIWI-oem/build/image-root/root/.root.keyfile]
> [  209s] [ DEBUG   ]: 11:14:31 | EXEC: [cryptsetup --key-file
> /var/tmp/kiwi_i6yxwrb7 luksOpen /dev/loop0p3 luksRoot]
> [  211s] [  206.120504][ T5701] device-mapper: table: 254:0: crypt: Error
> allocating crypto tfm (-ENOENT)
> [  211s] [  206.120755][ T5701] device-mapper: ioctl: error adding target to
> table
> [  211s] [ DEBUG   ]: 11:14:34 | EXEC: Failed with stderr: device-mapper:
> reload ioctl on luksRoot (254:0) failed: No such file or directory
> [  211s] , stdout: (no output on stdout)
> [  211s] [ ERROR   ]: 11:14:34 | KiwiCommandError: cryptsetup: stderr:
> device-mapper: reload ioctl on luksRoot (254:0) failed: No such file or
> directory
> [  211s] , stdout: (no output on stdout)
> 
> 
> This is probably something related to the RT kernel, I'm attaching the full
> log.
> 

It's not particularly clear but this appears to be the creation of the image itself, not necessarily a running an RT environment. There is no dmesg attached to be sure but the log itself says

[    7s] 2nd stage started in virtual machine
[    7s] machine type: x86_64
[    7s] Linux version: 6.4.0-3-default #1 SMP PREEMPT_DYNAMIC Thu Oct 26 13:01:50 UTC 2023 (5b5b193)

This is not an RT kernel and the final error message says there is no TFM for the luks key being added. I'm not a crypto expert so I'm not sure but I'm guessing that the root keyfile is based on a crypto algorithm that is not available in the running kernel.

Can you confirm whether an RT kernel is running at the time of failure? Can you provide reproduction steps for this problem outside of the OBS environment?
Comment 4 Fabian Vogt 2024-02-23 12:54:18 UTC
The issue is that kernel-obs-build does not contain the necessary modules, probably just "xts".

The reason it works for the non-RT builds is that there's an awful hack in config.sh, it forces loading the xts module from the built image into the build env kernel. For kernel-default this usually works.
Comment 5 Fabian Vogt 2024-07-11 09:11:40 UTC
(In reply to Fabian Vogt from comment #4)
> The issue is that kernel-obs-build does not contain the necessary modules,
> probably just "xts".

kernel-obs-build includes xts meanwhile.