Bug 1702778

Summary: parted creates the Protective MBR with invalid sector value 1 in StartingCHS
Product: Red Hat Enterprise Linux 7 Reporter: Laszlo Ersek <lersek>
Component: partedAssignee: Brian Lane <bcl>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.7CC: jstodola, lmiksik, zveleba
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: parted-3.1-32.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 20:11:20 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 Laszlo Ersek 2019-04-24 18:09:52 UTC
*** Description of problem:

The UEFI spec requires the StartingCHS field in the protective MBR's
sole partition entry (with type 0xEE) to state cylinder=0, head=0,
sector=2. (Sectors in C/H/S notation are 1-based, not 0-based).

Parted currently sets sector=1 however, which does not conform to the
UEFI spec, and breaks some tools trying to validate the Protective MBR.

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

parted-3.1-31.el7

*** How reproducible:

100%

*** Steps to Reproduce:

1. Install RHEL-7 to a UEFI system (including a UEFI virtual machine).
   Anaconda will invoke parted for creating the GPT, plus a protective
   MBR.

2. On the installed system, check the sector value in the Protective
   MBR, with the following command:

   # hexdump  -C -n 512 /dev/sda

*** Actual results:

00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001c0  01 00 ee fe ff ff 01 00  00 00 ff ff 7f 0c 00 00  |..îţ˙˙....˙˙....|
          ^^
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............UŞ|
00000200

The byte at offset 0x1c0 (marked with ^^) has value 1.

*** Expected results:

The byte at offset 0x1c0 should have value 2.

*** Additional info:

- This issue has been fixed in upstream GNU Parted, in:

    http://git.savannah.gnu.org/cgit/parted.git/commit/?id=df6770d213b6

  Please backport the patch to RHEL-7. (Fedora already has the fix,
  starting with Fedora 27. RHEL-8 also has the fix.)

- The symptom (protective MBR validation failure) has been originally
  reported by "Xu, Wei6" <wei6.xu>, at
  <https://edk2.groups.io/g/devel/message/39486>. I'll ask the original
  reporter to assist with testing the bugfix.

Thanks!

Comment 6 Zdenek Veleba 2019-12-05 13:09:40 UTC
Fix verified in parted-3.1-32.el7 (RHEL-7.8-20191119.0)

Comment 8 errata-xmlrpc 2020-03-31 20:11:20 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-2020:1186