Skip to content

Commit f21c511

Browse files
committed
40rhcos-fips: include fips.so in initrd
Ignition panics when fips is enabled with golang 1.22. Golang 1.21 trusts openssl exclusively to tell whether FIPS mode is on or off but golang 1.22 looks at the system FIPS configuration directly. If the system is in FIPS mode but the initrd doesn't include the openssl FIPS module, golang 1.21 would assume it is not in FIPS mode whereas golang 1.22 sees that the openssl configuration doesn't match the system configuration and panics.
1 parent 7056860 commit f21c511

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

overlay.d/05rhcos/usr/lib/dracut/modules.d/40rhcos-fips/module-setup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ install() {
2828
inst_simple "$moddir/rhcos-fips-dracut-boot-fix.service" \
2929
"$systemdsystemunitdir/rhcos-fips-dracut-boot-fix.service"
3030

31+
# Golang 1.22 requires the fips shared object in the initrd to determine
32+
# whether the system is in FIPS mode and ignition will panic if its missing
33+
local src="/usr/lib64/ossl-modules/fips.so"
34+
local dest="/usr/lib64/ossl-modules/fips.so"
35+
if [ -f "$src" ]; then
36+
inst_simple "$src" "$dest"
37+
else
38+
echo "Warning: $src not found!"
39+
fi
40+
3141
# Unconditionally include /etc/system-fips in the initrd. This has no
3242
# practical effect if fips=1 isn't also enabled. OTOH, it is a *requirement*
3343
# for a true FIPS boot: https://bugzilla.redhat.com/show_bug.cgi?id=1778940

0 commit comments

Comments
 (0)