[UBUNTU 20.04] zipl boot loader should check for secure IPL feature before looking up data (was: PV: guest fails to reboot from a disk)

Bug #1892350 reported by bugproxy on 2020-08-20
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu on IBM z Systems
High
Skipper Bug Screeners
s390-tools (Ubuntu)
Undecided
Canonical Foundations Team
Focal
Undecided
Canonical Foundations Team
Groovy
Undecided
Canonical Foundations Team

Bug Description

[Impact]
 * Sometimes a PV guest fails to reboot from a disk.
 * Backporting newer zipl functionality to focal fixes the reboot of protected VMs on IBM Z by checking for the secure IPL feature before looking up data
 * This bug was fixed in s390-tools 2.14.0 (which depends on a newer kernel), therefore we cherry-pick just the fixes to zipl, while keeping s390-tools at 2.12.0

[Test Case]
 * Secure boot (s390-tools-signed) can only be tested on specific IBM hardware
 * Try to reboot a PV guest multiple times.
 * Or using hades (bb/mhartmay/pv branch):
$ for i in $(seq 1 100); do nose2 -v --early-debug tests.test_pv.PVChreiplTestCase; done

[Regression Potential]
 * regressions in the initial program loader for Z (zipl) could break the creation of new boot devices for s390x
 * the package is only available on s390x and thus could only affect IBM Z machines
 * Existing boot devices / IPL would not be affected

[Other Info]
 * Needs to be tested/verified by IBM internally
 * In addition to the patches/cherry-picks provided via the original description, I included fd81728 ("zipl: fix incorrect setup of stage3 flags") from upstream, to fix an issue introduced in commit 6c04f97 ("zipl: consolidate stage3_params structs and stage3 flags")
 * Related to LP: #1888231 and LP: #1893027

=== Original Description ===
Problem description:

Sometimes a PV guest fails to reboot from a disk.

# How to reproduce?
Try to reboot a PV guest multiple times.

Or using hades (bb/mhartmay/pv branch):
$ for i in $(seq 1 100); do nose2 -v --early-debug tests.test_pv.PVChreiplTestCase; done

# Host kernel used:
5.6.0-rc2-00041-g0c1beb8db4fc

# Host cmdline used:
kvm.nested=1 nokaslr crashkernel=196M selinux=0 root=/dev/disk/by-path/ccw-0.0.1000-part1 rd.dasd=0.0.1000 cio_ignore=all,!condev LANG=en_US.UTF-8 prot_virt=1

# QEMU used:
QEMU emulator version 4.2.50 (v4.2.0-1246-g3d17206cbf41-dirty)

# Guest kernel used:
5.6.0-rc2-00041-g0c1beb8db4fc

# Guest cmdline used:
enforcing=0 console=ttyS0 swiotlb=256000 STARTUP=sshd.sh PV

This is a list of commits that are required to entirely resolve this bug
on top of s390tools-2.12

These commits are zipl related only.

c91d8bd5f9102cb91ba6839cf98c40dd26521cd3
fb62cc9e14591c7f84944148d48ac98114a26d46
f4f2220693ffe2efadfd41e0036f6971aabc1fdd
e0ffb3c584f57783538773b3edabbbb5f48caefc
e67f6300862d939d212d79c4ce5e1249102ddcd3
c4a0933165c7093c2ca52c9ee94e4b074fc9f3f7
cb11d6baec41f14c3e8f6832a13ea0020dcf907d
6c04f977734f55b862b9900abfc325e1db98acd0
ce65c39e18a62743bf65eeec92eaedbe22d035da
19f747847ffb39cb2df43376ff569bf18a026362
eb4e806cdc0801718e3d74b2062700d57f6f4b5a
93a0cb254efe45b5e291283af69d74f531cdc40d
2fe5f27975785a3af91d0b24f88962c7ae82ed44
cc069af26d1c35e35bca9d7db4ee4d8a0f8f5440
0843b7db36af3e30c97fd8be8173debe9f5510b7
1a150b2fe05627adc43cc00dd2291acfff30735a
9a68a25ab609146e0c22ae882a2f80c6da714761
4eea67cd6f100e7db7b71a03495e97a8db96490a
0ac7ce964ed089a2614dbfcffb89bd6c4175992b
0c583ec1a68e998f5ed775a97d7f046aad5df28a
1b65b23b43985cb8a1da2ef399ec6def31bbcc69
454f1427d3edcd94c2e25fe7165d392bcc97567a
71b36d17f019c9e2cf218351520d5b55a6c2d479
41fae58ecd8d0099ce2802f43e6b998eecc818c7
3217e0438fd8ba602706eda8adbb23e74f2f54ad
ae66f795124fb3b5e57637ff002edbf45f05ccbd
d7b816ff58baed404b5406a7c25e390804ff1a76
c367a6bb6529f04bdcb6264ede99439a756dfa3e
943c5dc51d493fd89f8c1b0760656446d5653be6

bugproxy (bugproxy) on 2020-08-20
tags: added: architecture-s39064 bugnameltc-187747 severity-high targetmilestone-inin2004
Changed in ubuntu:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
affects: ubuntu → linux (Ubuntu)
affects: linux (Ubuntu) → s390-tools (Ubuntu)
summary: - [UBUNTU 20.04]zipl boot loader should check for secure IPL feature
+ [UBUNTU 20.04] zipl boot loader should check for secure IPL feature
before looking up data (was: PV: guest fails to reboot from a disk)
Changed in ubuntu-z-systems:
importance: Undecided → High
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Frank Heimes (fheimes) wrote :

The list of commits is included in s390-tools 2.14, hence if s390-tools gets updated to 2.14 (see LP 1884721), the groovy entry will be done.h
But SRU to focal is needed.
I think it will not be easy to get all commit IDs SRUed to focal - even if I've heard that the fix is only one of them and the rest are depending commits to get the fix applied ...

Changed in s390-tools (Ubuntu Groovy):
status: New → Triaged
assignee: Skipper Bug Screeners (skipper-screen-team) → Canonical Foundations Team (canonical-foundations)
Changed in s390-tools (Ubuntu Focal):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Changed in ubuntu-z-systems:
assignee: Canonical Foundations Team (canonical-foundations) → Skipper Bug Screeners (skipper-screen-team)
status: New → Triaged
Changed in s390-tools (Ubuntu Groovy):
status: Triaged → In Progress
Frank Heimes (fheimes) on 2020-08-26
Changed in ubuntu-z-systems:
status: Triaged → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package s390-tools - 2.14.0-1ubuntu1

---------------
s390-tools (2.14.0-1ubuntu1) groovy; urgency=medium

  * Merge from Debian, remaining changes:
    - add libssl-dev, libglib2.0-dev build-deps
    - add support for signed zipl
    - package cpuplugd, osasnmpd, statd, zkey
    - update copyright file
    - fix kernel installer script integration, to skip calling zipl without initrd
    - load monwriter kernel module for mon_statd/mon_fsstatd
    - do not run dumpconf in lxc
    - ziomon change exit code to 0 for version and help
    - add zkey initramfs hook
    - change zkey default back to argon2i
    - drop patch that disables building osasnmpd
    - drop udevpath patch to init script, systemd units are used instead
    - enable hardening
    - enable initramfs & dracut integration
    - install more utilities and zdev initramfs integration
    - setup users/groups for mon_*, iucvterm, zkey
    - setup crashkernel integration
    - ship zdev in udeb
    - drop ziomon package, shipped in the main package

  * New upstream release fixes LP: #1892350, LP: #1888231, LP: #1884773,
    LP: #1884744, LP: #1884721

s390-tools (2.14.0-1) unstable; urgency=medium

  * New upstream release.

s390-tools (2.3.0-2) unstable; urgency=medium

  * Hardcode perl dependency instead of using ${perl:Depends}.
    The latter introduces a multi-arch dependency (perl:any) that the
    base installation environment cannot cope with.

 -- Dimitri John Ledkov <email address hidden> Wed, 26 Aug 2020 11:11:23 +0100

Changed in s390-tools (Ubuntu Groovy):
status: In Progress → Fix Released
tags: added: id-5f3e969561488979e4dce5fc
Lukas Märdian (slyon) wrote :

I think we should also include fd817280d315ca0249bbdd9cd21bcd54a39bceda ("zipl: fix incorrect setup of stage3 flags") if we cherry-pick all the other patches, as that one fixes an issue introduced in another cherry-pick (6c04f977734f55b862b9900abfc325e1db98acd0 "zipl: consolidate stage3_params structs and stage3 flags")

Lukas Märdian (slyon) on 2020-10-01
description: updated
description: updated
description: updated
Lukas Märdian (slyon) on 2020-10-01
description: updated
Frank Heimes (fheimes) on 2020-10-01
Changed in s390-tools (Ubuntu Focal):
status: New → In Progress

Hello bugproxy, or anyone else affected,

Accepted s390-tools into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/s390-tools/2.12.0-0ubuntu3.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in s390-tools (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Changed in ubuntu-z-systems:
status: In Progress → Fix Committed
tags: added: fr-587
Dimitri John Ledkov (xnox) wrote :

@hws / ibm

Have you had a chance to verify this yet?

------- Comment From <email address hidden> 2020-10-23 03:27 EDT-------
Verified by IBM:
Verified that the code is correctly included in s390-tools_2.12.0-0ubuntu3.1

Frank Heimes (fheimes) wrote :

Thx for the verification! (I've adjusted the tags accordingly).

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers