[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
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu on IBM z Systems
Fix Released
High
Skipper Bug Screeners
s390-tools (Ubuntu)
Fix Released
Undecided
Canonical Foundations Team
Focal
Fix Released
Undecided
Canonical Foundations Team
Groovy
Fix Released
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)
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)
Revision history for this message
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)
Changed in ubuntu-z-systems:
status: Triaged → In Progress
Revision history for this message
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
Revision history for this message
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)
description: updated
description: updated
description: updated
Lukas Märdian (slyon)
description: updated
Frank Heimes (fheimes)
Changed in s390-tools (Ubuntu Focal):
status: New → In Progress
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

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
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@hws / ibm

Have you had a chance to verify this yet?

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- 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

Revision history for this message
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
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package s390-tools - 2.12.0-0ubuntu3.1

---------------
s390-tools (2.12.0-0ubuntu3.1) focal; urgency=medium

  * debian/patches/0082-*.patch .. 0111-*.patch (LP: #1892350)
    - Cherrypick patches from upstream, to make zipl boot loader check for
      secure IPL feature before looking up data
    - Cherrypick 0111-*/fd81728 ("zipl: fix incorrect setup of stage3 flags")
      additionally, to fix bug in 0089-*/6c04f97 ("zipl: consolidate
      stage3_params structs and stage3 flags")
  * d/p/0110-zipl-stage3-correctly-handle-diag308-response-code.patch
    - Cherrypick 943c5dc ("zipl/stage3: correctly handle diag308 response
      code"), to fix KVM IPL without bootindex= specified (LP: #1888231)
  * d/p/0112-cpumf-lscpumf.pl-displays-raw-event-number-incorrect.patch
    - Only needed for perl lscpumf in Focal (LP: #1893027)

 -- Lukas Märdian <email address hidden> Thu, 01 Oct 2020 12:41:35 +0200

Changed in s390-tools (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for s390-tools has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: Fix Committed → Fix Released
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2020-10-26 06:19 EDT-------
IBM Bugzilla status->closed, Fix Released with all requested distros

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.