Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
.Clevis ignores commented devices in `crypttab`
Previously, Clevis tried to unlock commented devices in the `crypttab` file, causing the `clevis-luks-askpass` service to run even if the device was not valid. This caused unnecessary service runs and made it difficult to troubleshoot.
With this fix, Clevis ignores commented devices. Now, if an invalid device is commented, Clevis does not attempt to unlock it and `clevis-luks-askpass.service` finishes appropriately. This makes it easier to troubleshoot and reduces unnecessary service runs.
Description of problem:
When commenting out an entry in /etc/crypttab but the LUKS device still exists on the system, I can see clevis-luks-askpass.service never exiting and looping listing keys, etc., e.g.:
/etc/crypttab:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
#luks-64193b0a-fb00-4982-8a15-536813d3fba1 UUID=64193b0a-fb00-4982-8a15-536813d3fba1 none discard
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Disks:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
...
├─vda3 crypto 64193b0a-fb00-4982-8a15-536813d3fba1
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
This happens because clevis_devices_to_unlock() doesn't skip comments (but ignores the first field instead in while() loop on line 411):
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
403 clevis_devices_to_unlock() {
:
411 while read -r _ crypt_device _; do
:
436 done < /etc/crypttab
:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
This causes the function to return "64193b0a-fb00-4982-8a15-536813d3fba1" even though it's to be skipped.
This was fixed with Upstream commit below:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
commit 0589c149b2b7036752fc8cf0b18d851eb997ed60
Author: Todd Zullinger <tmz>
Date: Wed Nov 3 03:39:02 2021 -0400
luks: ignore empty & comment lines in crypttab
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Version-Release number of selected component (if applicable):
clevis-luks-15-8.el8 (8.6) and clevis-luks-15-11.el8 (8.7)
How reproducible:
Always
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (clevis bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2023:2868
Description of problem: When commenting out an entry in /etc/crypttab but the LUKS device still exists on the system, I can see clevis-luks-askpass.service never exiting and looping listing keys, etc., e.g.: /etc/crypttab: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- #luks-64193b0a-fb00-4982-8a15-536813d3fba1 UUID=64193b0a-fb00-4982-8a15-536813d3fba1 none discard -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Disks: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- # lsblk -f NAME FSTYPE LABEL UUID MOUNTPOINT ... ├─vda3 crypto 64193b0a-fb00-4982-8a15-536813d3fba1 -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- This happens because clevis_devices_to_unlock() doesn't skip comments (but ignores the first field instead in while() loop on line 411): -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- 403 clevis_devices_to_unlock() { : 411 while read -r _ crypt_device _; do : 436 done < /etc/crypttab : -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- This causes the function to return "64193b0a-fb00-4982-8a15-536813d3fba1" even though it's to be skipped. This was fixed with Upstream commit below: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- commit 0589c149b2b7036752fc8cf0b18d851eb997ed60 Author: Todd Zullinger <tmz> Date: Wed Nov 3 03:39:02 2021 -0400 luks: ignore empty & comment lines in crypttab -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Version-Release number of selected component (if applicable): clevis-luks-15-8.el8 (8.6) and clevis-luks-15-11.el8 (8.7) How reproducible: Always