Bug 2022841

Summary: Move zipl invocation after fips-mode-setup [s390x, FIPS]
Product: Red Hat Enterprise Linux 9 Reporter: Alexander Sosedkin <asosedki>
Component: anacondaAssignee: Radek Vykydal <rvykydal>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: jkonecny, jstodola, mlewando
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: anaconda-34.25.1.5-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 09:58:06 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:

Description Alexander Sosedkin 2021-11-12 17:47:02 UTC
This is a spin-off of bz2013195 at around bz2013195#13,
which might be useful for a wider context.

On s390x booting seems to be relatively fragile
and regeneration of initramfs
or other modification of bootloader-referenced files
needs to be followed by invoking `zipl`,
lest the system might be rendered unbootable.

It has been identified that Anaconda first calls `zipl` (s390x only),
and only then calls `fips-mode-setup --no-bootcfg` (fips=1 only).
`fips-mode-setup --no-bootcfg` regenerates initramfs
yet doesn't touch the bootloader, leaving anaconda to handle that.
`--no-bootcfg` currently includes not running `zipl` as well,
leaving the system unbootable.

Sounds like reordering these two operations
1) follows the current motive of "anaconda handles bootloader",
2) doesn't hurt even if `fips-mode-setup` is modified
   to also call `zipl` even with `--nobootcfg` passed.
Possibly `zipl` could be moved to an even later point
to lower the chances of other similar mis-orderings in the future.

Comment 1 Jiri Konecny 2022-01-14 10:50:21 UTC
Proposing for 9.1 planning.

Comment 3 Radek Vykydal 2022-05-27 11:50:07 UTC
https://github.com/rhinstaller/anaconda/pull/4147

Comment 4 Marta Lewandowska 2022-06-07 12:52:54 UTC
Reproduced using anaconda-34.25.0.29-1.el9_0.s390x (in released RHEL-9.0.0):
11:44:06,986 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:anaconda.threading:Running Thread: AnaTaskThread-FixZIPLBootloaderTask-1 (4395630590016)
11:44:06,986 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Running in chroot '/mnt/sysroot'... zipl
11:44:07,044 INFO zipl:Boot loader written to dasda (4018) - 5e:00
11:44:07,055 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Using config file '/etc/zipl.conf'
11:44:07,056 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Using BLS config file '/boot/loader/entries/6d6c7dbf18454bee942842dc35145e03-5.14.0-70.13.1.el9_0.s390x.conf'
11:44:07,056 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Using BLS config file '/boot/loader/entries/6d6c7dbf18454bee942842dc35145e03-0-rescue.conf'
11:44:07,056 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Building bootmap in '/boot'
11:44:07,056 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Building menu 'zipl-automatic-menu'
11:44:07,056 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Adding #1: IPL section '(5.14.0-70.13.1.el9_0.s390x)' (default)
11:44:07,056 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Adding #2: IPL section '(0-rescue-6d6c7dbf18454bee942842dc35145e03)'
11:44:07,056 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Preparing boot device: dasda (4018).
11:44:07,056 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Done.
11:44:07,056 WARNING org.fedoraproject.Anaconda.Modules.Storage:DEBUG:program:Return code: 0
11:44:07,056 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:anaconda.threading:Thread Done: AnaTaskThread-FixZIPLBootloaderTask-1 (4395630590016)
11:44:07,994 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:anaconda.threading:Running Thread: AnaTaskThread-ConfigureFIPSTask-1 (4396078581824)
11:44:07,995 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Running in chroot '/mnt/sysroot'... fips-mode-setup --enable --no-bootcfg


Verified using anaconda-34.25.1.5-1.el9.s390x (in RHEL-9.1.0-20220606.d.0):
12:35:03,574 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:anaconda.threading:Running Thread: AnaTaskThread-ConfigureFIPSTask-1 (4396468652096)
12:35:03,574 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Running in chroot '/mnt/sysroot'... fips-mode-setup --enable --no-bootcfg
12:35:07,544 INFO systemd:systemd-hostnamed.service: Deactivated successfully.
12:35:17,683 INFO systemd:anaconda-shell: Deactivated successfully.
12:35:17,685 INFO systemd:anaconda-shell: Scheduled restart job, restart counter is at 15.
12:35:17,685 INFO systemd:Stopped Shell on hvc1.
12:35:17,685 INFO systemd:Started Shell on hvc1.
12:35:26,159 INFO zipl:Boot loader written to dasda (3025) - 5e:00
12:35:26,276 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Kernel initramdisks are being regenerated. This might take some time.
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Using config file '/etc/zipl.conf'
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Using BLS config file '/boot/loader/entries/eb7ab409eb0d4ea8974c71acfad9c52f-5.14.0-105.kpq0.el9.s390x.conf'
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Using BLS config file '/boot/loader/entries/eb7ab409eb0d4ea8974c71acfad9c52f-0-rescue.conf'
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Building bootmap in '/boot'
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Building menu 'zipl-automatic-menu'
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Adding #1: IPL section '(5.14.0-105.kpq0.el9.s390x)' (default)
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Adding #2: IPL section '(0-rescue-eb7ab409eb0d4ea8974c71acfad9c52f)'
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Preparing boot device: dasda (3025).
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Done.
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Preserving current FIPS-based policy FIPS.
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Please review the subpolicies to ensure they only restrict, not relax the FIPS policy.
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Setting system policy to FIPS
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Note: System-wide crypto policies are applied on application start-up.
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:It is recommended to restart the system for the change of policies
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:to fully take place.
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:FIPS mode will be enabled.
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:Now you need to configure the bootloader to add kernel options "fips=1 boot=UUID=2f64b1cb-7b0f-47af-a638-126cd3cc396a"
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:program:and reboot the system for the setting to take effect.
12:35:26,277 WARNING org.fedoraproject.Anaconda.Modules.Security:DEBUG:program:Return code: 0
12:35:26,278 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:anaconda.threading:Thread Done: AnaTaskThread-ConfigureFIPSTask-1 (4396468652096)
12:35:26,629 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:anaconda.threading:Running Thread: AnaTaskThread-RealmJoinTask-1 (4396468652096)
12:35:26,629 WARNING org.fedoraproject.Anaconda.Modules.Security:DEBUG:anaconda.modules.security.installation:No realm has been discovered, so not joining any realm.
12:35:26,629 WARNING org.fedoraproject.Anaconda.Modules.Security:INFO:anaconda.threading:Thread Done: AnaTaskThread-RealmJoinTask-1 (4396468652096)
12:35:26,631 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:anaconda.threading:Running Thread: AnaTaskThread-FixZIPLBootloaderTask-1 (4395760613440)
12:35:26,631 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Running in chroot '/mnt/sysroot'... zipl
12:35:26,688 INFO zipl:Boot loader written to dasda (3025) - 5e:00
12:35:26,690 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Using config file '/etc/zipl.conf'
12:35:26,690 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Using BLS config file '/boot/loader/entries/eb7ab409eb0d4ea8974c71acfad9c52f-5.14.0-105.kpq0.el9.s390x.conf'
12:35:26,690 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Using BLS config file '/boot/loader/entries/eb7ab409eb0d4ea8974c71acfad9c52f-0-rescue.conf'
12:35:26,690 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Building bootmap in '/boot'
12:35:26,690 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Building menu 'zipl-automatic-menu'
12:35:26,690 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Adding #1: IPL section '(5.14.0-105.kpq0.el9.s390x)' (default)
12:35:26,690 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Adding #2: IPL section '(0-rescue-eb7ab409eb0d4ea8974c71acfad9c52f)'
12:35:26,690 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Preparing boot device: dasda (3025).
12:35:26,690 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:program:Done.
12:35:26,691 WARNING org.fedoraproject.Anaconda.Modules.Storage:DEBUG:program:Return code: 0
12:35:26,691 WARNING org.fedoraproject.Anaconda.Modules.Storage:INFO:anaconda.threading:Thread Done: AnaTaskThread-FixZIPLBootloaderTask-1 (4395760613440)

setting Verified: Tested

Comment 7 Jan Stodola 2022-06-08 13:11:49 UTC
Checked that anaconda-34.25.1.5-1.el9 is in nightly compose RHEL-9.1.0-20220608.0

Moving to VERIFIED

Comment 9 errata-xmlrpc 2022-11-15 09:58:06 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 (anaconda 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-2022:7977