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 2159440 - clevis_devices_to_unlock() doesn't skip comments, causing clevis-luks-askpass.service to always run
Summary: clevis_devices_to_unlock() doesn't skip comments, causing clevis-luks-askpass...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: clevis
Version: 8.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Sergio Arroutbi
QA Contact: Martin Zelený
Jan Fiala
URL:
Whiteboard:
Depends On:
Blocks: 2159728
TreeView+ depends on / blocked
 
Reported: 2023-01-09 15:33 UTC by Renaud Métrich
Modified: 2023-05-16 10:02 UTC (History)
4 users (show)

Fixed In Version: clevis-15-12.el8
Doc Type: Bug Fix
Doc Text:
.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.
Clone Of:
: 2159728 (view as bug list)
Environment:
Last Closed: 2023-05-16 08:39:14 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker NMT-6 0 None None None 2023-01-19 11:21:46 UTC
Red Hat Issue Tracker RHELPLAN-144547 0 None None None 2023-01-09 15:35:34 UTC
Red Hat Issue Tracker SECENGSP-4954 0 None None None 2023-01-09 15:35:37 UTC
Red Hat Product Errata RHBA-2023:2868 0 None None None 2023-05-16 08:39:19 UTC

Description Renaud Métrich 2023-01-09 15:33:15 UTC
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

Comment 12 Sergio Arroutbi 2023-01-19 11:18:16 UTC
@jafiala : Changes in doc text LGTM. Thanks

Comment 17 errata-xmlrpc 2023-05-16 08:39:14 UTC
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


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