FS#79277 - [systemd] systemd-cryptenroll fails when enrolling TPM2
Attached to Project:
Arch Linux
Opened by nl6720 (nl6720) - Wednesday, 02 August 2023, 10:29 GMT
Last edited by Toolybird (Toolybird) - Friday, 11 August 2023, 07:52 GMT
Opened by nl6720 (nl6720) - Wednesday, 02 August 2023, 10:29 GMT
Last edited by Toolybird (Toolybird) - Friday, 11 August 2023, 07:52 GMT
|
Details
Description:
With systemd 254, systemd-cryptenroll fails to enroll TPM2 and its PCRs. E.g.: # systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=5+7+12 /dev/disk/by-partlabel/Arch\\x20Linux 🔐 Please enter current passphrase for disk /dev/disk/by-partlabel/Arch\x20Linux: WARNING:esys:src/tss2-esys/api/Esys_StartAuthSession.c:391:Esys_StartAuthSession_Finish() Received TPM Error ERROR:esys:src/tss2-esys/api/Esys_StartAuthSession.c:136:Esys_StartAuthSession() Esys Finish ErrorCode (0x000002c4) Failed to open session in TPM: tpm:parameter(2):value is out of range or is not correct for the context No matter what values are passed to --tpm2-pcrs= or even if it's omitted, systemd-cryptenroll fails with this error. If I downgrade systemd and systemd-libs to 253.7, then the command succeeds without any issue. Additional info: * package version(s) * config and/or log files etc. * link to upstream bug report, if any systemd 254-1 systemd-libs 254-1 tpm2-tss 4.0.1-1 Steps to reproduce: # systemd-cryptenroll --tpm2-device=auto /dev/insert_luks_device_here |
This task depends upon
Closed by Toolybird (Toolybird)
Friday, 11 August 2023, 07:52 GMT
Reason for closing: Not a bug
Additional comments about closing: "Fixed by clearing the TPM.
¯\_(ツ)_/¯"
Friday, 11 August 2023, 07:52 GMT
Reason for closing: Not a bug
Additional comments about closing: "Fixed by clearing the TPM.
¯\_(ツ)_/¯"
Downgrading systemd, systemd-libs and systemd-sysvcompat to version 253.7-1 (found locally in /var/cache/pacman/pkg) helped.
This is the command I used to downgrade:
```
sudo pacman -U /var/cache/pacman/pkg/systemd*-253.7-1-x86_64.pkg.tar.zst
```
However, enrolling fails with a different error on my end:
```
ERROR:esys:src/tss2-esys/api/Esys_Create.c:134:Esys_Create() Esys Finish ErrorCode (0x00000184)
```
I don't have the warning before the error at hand, because I already downgraded and copied the error message from my search history.
EDIT: here's my initrd hooks: `base systemd autodetect modconf kms keyboard sd-vconsole block sd-encrypt filesystems fsck`
[1] https://wiki.archlinux.org/title/Trusted_Platform_Module