Bug 1965482 - Cannot decrypt LUKS volumes with fido2 device
Summary: Cannot decrypt LUKS volumes with fido2 device
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 34
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-27 19:13 UTC by Juan Orti
Modified: 2022-06-08 00:55 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-08 00:55:21 UTC
Type: Bug


Attachments (Terms of Use)
rdsosreport.txt (247.21 KB, text/plain)
2021-05-27 19:13 UTC, Juan Orti
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github systemd systemd issues 19872 0 None open FIDO2 fallback to password 2021-06-24 09:22:39 UTC

Description Juan Orti 2021-05-27 19:13:02 UTC
Created attachment 1787680 [details]
rdsosreport.txt

Description of problem:
I've enrolled my FIDO2 device (Yubikey 5) as a method to unlock my LUKS2 partitions as described in this article:

http://0pointer.net/blog/unlocking-luks2-volumes-with-tpm2-fido2-pkcs11-security-hardware-on-systemd-248.html

Booting with "fido2-device=auto" in crypttab doesn't work and drops me to dracut's rescue shell. 

Version-Release number of selected component (if applicable):
systemd-248.3-1.fc34.x86_64
systemd-udev-248.3-1.fc34.x86_64
cryptsetup-2.3.5-2.fc34.x86_64
dracut-054-12.git20210521.fc34.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Enroll the swap and root LUKS2 partitions:

# systemd-cryptenroll --fido2-device=auto /dev/nvme0n1p6
# systemd-cryptenroll --fido2-device=auto /dev/nvme0n1p7

2. Update /etc/crypttab

luks-9e4a0d32-860a-4c93-8ce8-a949e55dafe9 UUID=9e4a0d32-860a-4c93-8ce8-a949e55dafe9 - fido2-device=auto,discard
luks-a18bef38-c17a-4b60-bbc2-84c2fd87bceb UUID=a18bef38-c17a-4b60-bbc2-84c2fd87bceb - fido2-device=auto,discard

3. Rebuild dracut

# dracut -f

4. Reboot

Actual results:
The boot process drops me to a rescue shell after several minutes of timeout. It doesn't ask the password at any moment and touching the Yubikey does nothing. This message is logged:

systemd-cryptsetup[645]: Set cipher aes, mode xts-plain64, key size 512 bits for device /dev/disk/by-uuid/9e4a0d32-860a-4c93-8ce8-a949e55dafe9.
systemd-cryptsetup[645]: Automatically discovered security FIDO2 token unlocks volume.
systemd-cryptsetup[645]: FIDO2 support is not installed.

Expected results:
Unlocking the LUKS devices with the Yubikey. Alternatively if the device is not present, ask for a password.

Additional info:

Comment 1 James 2021-06-23 20:00:52 UTC
Confirmed here with the 'blue' Yubico security key NFC.

Comment 2 James 2021-06-23 20:26:56 UTC
Hmm... well I tried ensuring /usr/lib64/libfido2.so.* was in the initramfs by creating /etc/dracut.conf.d/fido2.conf with 

install_optional_items+=" /usr/lib64/libfido2.so.* "

and the libraries are in the image. This works ONLY IF the token is plugged in before boot and then tapped when it flashes.

If the token is not present at the outset, the display just spins instead of presenting a password prompt. There's no clean way to get out of this. This is not the user experience I'd expected!

Comment 3 Zbigniew Jędrzejewski-Szmek 2021-06-24 09:21:00 UTC
Heh, I wanted to post the following comment yesterday, but bugzilla said "midair collision detected"…
> Can you show the the output of 'lsinitrd' on the dracut image?
> I suspect the tpm libraries are missing there.
You already answered that, thanks.

OK, so this looks like a separate bug.

Some people reported similar problems in https://github.com/systemd/systemd/issues/19872.
If you could attach the debug logs from the failing case, that'd be useful.

Comment 4 Juan Orti 2021-06-26 10:53:00 UTC
I've created this bug for the missing libraries in the dracut image:

https://bugzilla.redhat.com/show_bug.cgi?id=1976462

Comment 5 Ben Cotton 2022-05-12 16:35:35 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 6 Ben Cotton 2022-06-08 00:55:21 UTC
Fedora Linux 34 entered end-of-life (EOL) status on 2022-06-07.

Fedora Linux 34 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.