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.
Description of problem:
Tools using libcryptsetup print "Running in FIPS mode." constantly on STDOUT, which makes the output not be parse-able.
This in particular breaks Clevis when it tries to unlock LUKS1 devices on boot:
/usr/bin/clevis-decrypt gets "Running in FIPS mode." input instead of expected Slot and UUID when being called from /usr/libexec/clevis-luks-askpass below:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
62 if pt="`luksmeta load -d $d -s $slot -u $UUID | clevis decrypt`"; then
63 echo -n "+$pt" | nc -U -u --send-only "$s"
64 unlocked=true
65 break
66 fi
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
After booting and enabling FIPS, we can indeed see that "luksmeta" command shows logs on stdout constantly:
RHEL 8.0 (OK):
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# luksmeta show -d /dev/rhel/00
0 active empty
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
RHEL 8.1 (FAIL):
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# luksmeta show -d /dev/rhel/00
Running in FIPS mode.
0 active empty
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Version-Release number of selected component (if applicable):
cryptsetup-2.2.0-2.el8.x86_64
How reproducible:
Always with FIPS
Additional info:
commit 493e8580d6c4f0f4128c4035005e1be0fc015398
Author: Milan Broz <gmazyland>
Date: Sun Oct 21 11:25:13 2018 +0200
Log all debug messages through log callback.
This cahnge allow to redirect all output of library
to a log processor.
is the culprit:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
@@ -111,21 +103,18 @@ void tool_log(int level, const char *msg, void *usrptr __attribute__((unused)))
switch(level) {
case CRYPT_LOG_NORMAL:
- fputs(msg, stdout);
+ fprintf(stdout, "%s", msg);
break;
case CRYPT_LOG_VERBOSE:
if (opt_verbose)
- fputs(msg, stdout);
+ fprintf(stdout, "%s", msg);
break;
case CRYPT_LOG_ERROR:
- fputs(msg, stderr);
+ fprintf(stderr, "%s", msg);
break;
case CRYPT_LOG_DEBUG:
if (opt_debug)
- printf("# %s\n", msg);
- break;
- default:
- fprintf(stderr, "Internal error on logging class for msg: %s", msg);
+ fprintf(stdout, "# %s\n", msg);
break;
}
}
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Yes, cryptsetup library logs all messages (with normal, verbose or error level) unless application provides own log callback function since version 2.1.0. The custom log callbacke can be set per context crypt_set_log_callback(cd != NULL) or default for whole library crypt_set_log_callback(cd == NULL). I can't simply revert this commit because we fixed another more severe problem with libcryptsetup logging with that commit.
Sergoi,
what is desired log level from libcryptsetup for luksmeta utility?
(In reply to Ondrej Kozina from comment #1)
> Yes, cryptsetup library logs all messages (with normal, verbose or error
> level) unless application provides own log callback function since version
> 2.1.0. The custom log callbacke can be set per context
> crypt_set_log_callback(cd != NULL) or default for whole library
> crypt_set_log_callback(cd == NULL). I can't simply revert this commit
> because we fixed another more severe problem with libcryptsetup logging with
> that commit.
>
> Sergoi,
>
> what is desired log level from libcryptsetup for luksmeta utility?
CRYPT_LOG_ERROR should be enough for us. As Renaud pointed out, the issue is that the verbose log ("Running in FIPS mode.") is going to stdout. Probably something like this can help here, as now the log will go to stderr: https://github.com/latchset/luksmeta/pull/12
With updated patch based on https://github.com/latchset/luksmeta/pull/12 (see the comment) it should work as expected. Anyway let me know, if there other issues with libcryptsetup logging.
Note LUKSv1 is not the default, but due to BZ 1759972 and related reproducer customers will probably use it without noticing at all:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
When installing a system using the GUI and choosing "Custom" for Storage Configuration and "Encryption", the MANUAL PARTITIONING panel opens.
Then there are 2 possibilities:
1. Clicking on "Click here to create them automatically"
or
2. Press the "+" button to start creating partitions
When using option 2. and adding partitions, the following happens:
- /boot is hosted on /dev/vda1 (OK)
- / is hosted on luks-rhel-00 logical volume
- /usr is hosted on luks-rhel-01 logical volume
- ...
It appears that all this ends up with having 1 VG created on /dev/vda2 and one LUKS1 device per logical volume.
There are then multiple issues appearing:
- Logical Volume name cannot be renamed through "Name:" field (e.g. from "00" to "root"): the description under the mount point left is updated, but not the "Name:" field
- LUKS2 cannot be chosen, the installer forces using LUKS1
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
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, 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-2020:1695
Description of problem: Tools using libcryptsetup print "Running in FIPS mode." constantly on STDOUT, which makes the output not be parse-able. This in particular breaks Clevis when it tries to unlock LUKS1 devices on boot: /usr/bin/clevis-decrypt gets "Running in FIPS mode." input instead of expected Slot and UUID when being called from /usr/libexec/clevis-luks-askpass below: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- 62 if pt="`luksmeta load -d $d -s $slot -u $UUID | clevis decrypt`"; then 63 echo -n "+$pt" | nc -U -u --send-only "$s" 64 unlocked=true 65 break 66 fi -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- After booting and enabling FIPS, we can indeed see that "luksmeta" command shows logs on stdout constantly: RHEL 8.0 (OK): -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- # luksmeta show -d /dev/rhel/00 0 active empty -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- RHEL 8.1 (FAIL): -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- # luksmeta show -d /dev/rhel/00 Running in FIPS mode. 0 active empty -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Version-Release number of selected component (if applicable): cryptsetup-2.2.0-2.el8.x86_64 How reproducible: Always with FIPS Additional info: commit 493e8580d6c4f0f4128c4035005e1be0fc015398 Author: Milan Broz <gmazyland> Date: Sun Oct 21 11:25:13 2018 +0200 Log all debug messages through log callback. This cahnge allow to redirect all output of library to a log processor. is the culprit: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- @@ -111,21 +103,18 @@ void tool_log(int level, const char *msg, void *usrptr __attribute__((unused))) switch(level) { case CRYPT_LOG_NORMAL: - fputs(msg, stdout); + fprintf(stdout, "%s", msg); break; case CRYPT_LOG_VERBOSE: if (opt_verbose) - fputs(msg, stdout); + fprintf(stdout, "%s", msg); break; case CRYPT_LOG_ERROR: - fputs(msg, stderr); + fprintf(stderr, "%s", msg); break; case CRYPT_LOG_DEBUG: if (opt_debug) - printf("# %s\n", msg); - break; - default: - fprintf(stderr, "Internal error on logging class for msg: %s", msg); + fprintf(stdout, "# %s\n", msg); break; } } -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------