RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1784084 - Automatic unlocking using Clevis + TPM2 doesn't happen for non-root volumes
Summary: Automatic unlocking using Clevis + TPM2 doesn't happen for non-root volumes
Keywords:
Status: CLOSED DUPLICATE of bug 1784524
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: clevis
Version: 8.1
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 8.0
Assignee: Sergio Correia
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-16 17:02 UTC by Renaud Métrich
Modified: 2023-03-24 16:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-13 11:06:37 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Renaud Métrich 2019-12-16 17:02:00 UTC
Description of problem:

Trying to automatically unlock a non-root volume, e.g. /home backed on LVM "data" VG and "lv_home" LV, LVM VG being LUKS encrypted backed on /dev/sda3, it happens that automatic unlocking doesn't happen automatically.

Article https://access.redhat.com/articles/4500491 describes how to work around this, but this is extremely complicated. Everything should just work without heavy administration intervention.

The root cause of the issue is there is no clevis-luks-askpass service running *yet* at the time the LVM VG "data" is set up.
Indeed, current clevis-luks-askpass.{path|service} assume that the Network is up, which is false assumption here. It is just *not* possible to delay the opening of the LVM VG until the network is there (this could also create other issues, such as not being able to start services).

To fix all this, it is in fact *sufficient* to start clevis-luks-askpass.{path|service} early during the boot phase, by modifying the corresponding units as shown below:

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# cat > /etc/systemd/system/clevis-luks-askpass.path << EOF
[Unit]
Description=Clevis systemd-ask-password Watcher
DefaultDependencies=no
Conflicts=shutdown.target
Before=cryptsetup.target

[Path]
PathChanged=/run/systemd/ask-password

[Install]
WantedBy=cryptsetup.target
EOF
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# cat > /etc/systemd/system/clevis-luks-askpass.service << EOF
[Unit]
Description=Clevis LUKS systemd-ask-password Responder
DefaultDependencies=no
Conflicts=shutdown.target

[Service]
Type=oneshot
ExecStart=/usr/libexec/clevis-luks-askpass -l
EOF
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Enable the unit:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# systemctl daemon-reload
# systemctl enable clevis-luks-askpass.path
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


This solves *all problems* (apparently, please double-check):
- in case Tang is used (Tang requires the network), the service will anyway work because the network has already been set up in the initramfs. This *only* assumes the network is always up in the initramfs, even if no root volume is encrypted (currently it's the case, because rd.neednet=1)
- in case TPM2 is used, this also works since everything is local


Version-Release number of selected component (if applicable):

clevis*-11-2.el8.x86_64

How reproducible:

Always


Steps to Reproduce:
1. Bind a non-root LUKS device to TPM2
2. Reboot

Actual results:

No unlocking


Additional info:

In an ideal world, the clevis-luks-asspath.path unit should be enabled automatically, without using "systemctl enable ...", but I don't know exactly how to make this possible.


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