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.

Bug 1640981

Summary: System booting with iSCSI and FIPS fails to boot when /boot has "x-initrd.mount" option
Product: Red Hat Enterprise Linux 7 Reporter: Renaud Métrich <rmetrich>
Component: dracutAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.5CC: dracut-maint-list, fkrska, jstodola
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dracut-033-560.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 13:13:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1630917, 1643104    

Description Renaud Métrich 2018-10-19 10:40:40 UTC
Description of problem:

When booting a system with / and /boot on iSCSI, mounting /boot early in the initramfs ("x-initrd.mount") and enabling FIPS, the system cannot boot because fips.sh doesn't find the .hmac file for the kernel.

Additionally, 20 seconds are lost during boot because pre-trigger "01-fips-boot.sh" tries to mount "/boot" but at this step, there is no network and no iscsi yet.


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

dracut-fips-033-535.el7_5.1.x86_64


How reproducible:

Always


Steps to Reproduce:
1. Install a VM with disk on iSCSI
2. Configure "x-initrd.mount" for "/boot"
3. Enable fips


Actual results:

...
[  OK  ] Mounted /sysroot/boot.
...
[   28.860906] dracut-pre-pivot[801]: mount: /dev/sdb is already mounted or /boot busy
[   28.864732] dracut-pre-pivot[801]: /dev/sdb is already mounted on /sysroot/boot
...
[   30.399698] dracut: FATAL: FIPS integrity test failed
[   29.706306] dracut-pre-pivot[801]: Warning: /boot/.vmlinuz-3.10.0-862.14.4.el7.x86_64.hmac does not exist
[   30.403843] dracut: Refusing to continue

Comment 2 Renaud Métrich 2018-10-19 10:49:21 UTC
The root cause is 01-fips-noboot.sh runs in "pre-pivot", which happens after "systemd-mount.service" was executed.

Due to having "x-initrd.mount" for "/boot", systemd mounts the partition to "/sysroot/boot".
Then in pre-pivot, 01-fips-noboot.sh mounts the partition to "/boot" which fails since it is already mounted on "/sysroot/boot".

The 20 seconds delay booting is also problematic. This is due to running 01-fips-boot.sh in "pre-trigger".

I don't understand why FIPS check runs at this step, I do not see any reason for that.

Moving the check to "pre-mount" instead fixes all the issues:
- no delay anymore since devices are now present
- mount of "/boot" happens before systemd does the mounts under /sysroot/ hierarchy

Proposed patch:

# diff -u $PWD/module-setup.sh $PWD/module-setup.sh.new
--- /lib/dracut/modules.d/01fips/module-setup.sh	2018-06-13 10:15:23.000000000 +0200
+++ /lib/dracut/modules.d/01fips/module-setup.sh.new	2018-10-19 12:22:21.887000000 +0200
@@ -40,7 +40,7 @@
 
 install() {
     local _dir
-    inst_hook pre-trigger 01 "$moddir/fips-boot.sh"
+    inst_hook pre-mount 01 "$moddir/fips-boot.sh"
     inst_hook pre-pivot 01 "$moddir/fips-noboot.sh"
     inst_script "$moddir/fips.sh" /sbin/fips.sh
 


Same needs to be done Upstream.

Comment 8 errata-xmlrpc 2019-08-06 13:13:38 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, 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-2019:2289