Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dracut: Correctly add pkey_cca kernel mod for cex card #2009

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

madhu-pillai
Copy link
Contributor

While doing testing hardware disk encryption using cex on 4.19 rhel 9.6 failed to detect cex domain for luks encryption.

[   23.293503] ignition[970]: Ignition failed: failed to create luks: generating secure key: generating secure key: exit status 1: Cmd: "zkey" "generate" "--name" "ignition-luks-root" "--key-type" "CCA-AESCIPHER" "--xts" "--description" "Secure Key for root Volume" "--apqns" "00.0047" Stdout: "" Stderr: "zkey: No APQN is available that can generate a secure key of type CCA-AESCIPHER\n"
[   23.294715] systemd[1]: ignition-disks.service: Main process exited, code=exited, status=1/FAILURE
[FAILED] Failed to start Ignition (disks).
[   23.295000] systemd[1]: Failed to start Ignition (disks).

when run the command in verbose mode folllowing logs found.

description "secure key" --apqns 00.0047 -voot --key-type CCA-AESCIPHER --xts --des 
zkey version 2.33.1-2.el9
Copyright IBM Corp. 2017, 2020
cription "secure key" --apqns 00.0047 -Voot --key-type CCA-AESCIPHER --xts --desc
zkey: Keystore in directory '/etc/zkey/repository' opened successfully
zkey: Device '/dev/pkey' has been opened successfully
zkey: File names for key 'ignition-luks-root': '/etc/zkey/repository/ignition-luks-root.skey' and '/etc/zkey/repository/ignition-luks-root.info'
zkey: Cross checking APQNs with mkvp 0000000000000000, min-level 6, and min-fw-version 0.0 (api: 0): 00.0047
zkey: Specified: 00.0047
zkey: mkvp for 00.0047: AES NEW: empty 0x0000000000000000
zkey: mkvp for 00.0047: AES CUR: valid 0xa40c15477abf80a7
zkey: mkvp for 00.0047: AES OLD: valid 0x71ecf46a35bd8924
zkey: mkvp for 00.0047: APKA NEW: empty 0x0000000000000000
zkey: mkvp for 00.0047: APKA CUR: valid 0x71772e2bf9e44214
zkey: mkvp for 00.0047: APKA OLD: valid 0x71772e2bf9e44214
zkey: mkvp for 00.0047: ASYM NEW: empty 0x00000000000000000000000000000000
zkey: mkvp for 00.0047: ASYM CUR: valid 0x12879b31fc17593939f460eaccd49ff4
zkey: mkvp for 00.0047: ASYM OLD: valid 0x12879b31fc17593939f460eaccd49ff4
zkey: Generate secure key by random
zkey: Build a list of APQNs for key type 2
zkey: ioctl PKEY_APQNS4KT rc: No such device
zkey: No APQN is available that can generate a secure key of type CCA-AESCIPHER
zkey: Failed to generate key 'ignition-luks-root': No such device

IBM suggested that there is split for pkey module in kernel version 5.14.0-556 pkey to pkey/pkey_cca/pkey_ep11/pkey_pckmo

pkey.ko is now a base module and "handler" modules pkey_cca.ko, pkey_ep11.ko.
You would need the pkey_cca.ko also in your initrd.

I've tested this in zVM, zKVM logs have attached for reference.
PKEY_CEX_DASD_Test.log
PKEY_CEX_FCP_Test.log
PKEY_CEX_KVM_Test.log

Copy link
Member

@HuijingHei HuijingHei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@travier
Copy link
Member

travier commented Feb 10, 2025

Can you add something like the following in your commit message and PR text:

Fixes: https://github.com/coreos/ignition/issues/2013

Thanks

@madhu-pillai madhu-pillai changed the title dracut: Add pkey_cca kernel mod for cex card Fixes: https://github.com/coreos/ignition/issues/2013 Feb 11, 2025
@madhu-pillai
Copy link
Contributor Author

Can you add something like the following in your commit message and PR text:

Fixes: https://github.com/coreos/ignition/issues/2013

Thanks

Done.
Thank you

prestist
prestist previously approved these changes Feb 12, 2025
Copy link
Collaborator

@prestist prestist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@prestist prestist dismissed their stale review February 12, 2025 17:07

Just noticed commit message

@travier
Copy link
Member

travier commented Feb 12, 2025

Can you add something like the following in your commit message and PR text:

Fixes: https://github.com/coreos/ignition/issues/2013

Done. Thank you

I meant adding it, not replacing everything. The entire first comment of this PR should be your commit message + the fixes line.

@travier
Copy link
Member

travier commented Feb 12, 2025

The previous PR title was also fine, the new one is not

Copy link
Collaborator

@prestist prestist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@madhu-pillai the changes look good; the commit message is wrong;

The Fixes: https://github.com/coreos/ignition/issues/2013 should be under the commit message.

i.e

    dracut: correctly add pkey_cca kernel module for cex support
    
    fixes:#2013

@madhu-pillai madhu-pillai changed the title Fixes: https://github.com/coreos/ignition/issues/2013 dracut: Correctly add pkey_cca kernel mod for cex card Feb 13, 2025
@prestist prestist merged commit c0680d6 into coreos:main Feb 20, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants