Bug 1022217 - fdisk mishandles GPT corruption
Summary: fdisk mishandles GPT corruption
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-22 17:40 UTC by Chris Murphy
Modified: 2013-11-10 08:13 UTC (History)
3 users (show)

Fixed In Version: util-linux-2.24-1.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-10 08:13:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Chris Murphy 2013-10-22 17:40:34 UTC
Description of problem: When the primary GPT is corrupt and the backup GPT is valid, fdisk incorrectly considers the disklabel to be dos (MBR). When either primary or backup GPT is corrupt, fdisk incorrectly doesn't inform the user, and doesn't enable restoration of the invalid GPT with information from the valid one.

Marking this bug as urgent because the entire point of having two GPTs is precisely to avoid the problem described in this bug.


Version-Release number of selected component (if applicable):
util-linux-2.24-0.1.fc20.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. Use parted or gdisk to create a GPT partitioned disk.
2. Use dd to modify LBA 2.
3. Try to edit the disk with fdisk.

Actual results:
fdisk reports the disk label type is dos.

Expected results:
fdisk is required by the UEFI spec to use the valid GPT and restore the invalid GPT (using the correct information in the valid GPT).

Additional info:

Further, if LBA -33 is modified instead in step 2 above; fdisk correctly considers the disk gpt, but incorrectly fails to inform the user that the backup GPT is corrupt and offers no obvious means of restoring it.

Try to edit the disk with either parted or gdisk. They will notify which GPT is corrupt, and that the other is being used instead, and upon write will restore the invalid GPT.

Comment 1 Karel Zak 2013-10-23 08:55:01 UTC
Fixed by upstream commit d2d9efa103a744363bd000e075435341c5256c8a. Fedora package will be updated ASAP.

Comment 2 Karel Zak 2013-10-23 10:10:14 UTC
.. and commit upstream commit 45ddb828ed7eef92db34841c9d583047b6a6c65e.

Comment 3 Fedora Update System 2013-10-23 11:09:58 UTC
util-linux-2.24-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/util-linux-2.24-1.fc20

Comment 4 Fedora Update System 2013-10-23 17:31:55 UTC
Package util-linux-2.24-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing util-linux-2.24-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-19766/util-linux-2.24-1.fc20
then log in and leave karma (feedback).

Comment 5 Chris Murphy 2013-10-25 04:12:31 UTC
Separately zero'd LBA 2 and LBA -33. fdisk, like gdisk and parted, complains about corruption of the proper GPT, and upon writing out existing the problem is fixed.

Repeated the test with a one byte change to the partitiontypeGUID of the first partition. Same results, fdisk catches the corruption in the proper GPT and fixes either one.

Bug appears to be fixed.

Comment 6 Fedora Update System 2013-11-10 08:13:46 UTC
util-linux-2.24-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.