libefi: efi_alloc_and_read should check for PMBR
The efi_alloc_and_read() is supposed to read the EFI (GPT) partition table, unfortunately it is possible, we get fabricated table (that is, generated in memory and not yet written down on device).
The one possible way around this issue is to verify if we have protective mbr on device (see 5 GUID Partition Table (GPT) Disk Layout, page 125, UEFI Specification v2.7). By inspecting the LBA0, we can implement the preliminary check for partition table.
As an side effect, the ufs mkfs code does need update for device size detection.
Updated by Electric Monk over 1 year ago
- % Done changed from 90 to 100
- Status changed from In Progress to Closed
commit fe12dc752b42da16028a16f4226e5295506fdb28 Author: Toomas Soome <firstname.lastname@example.org> Date: 2018-06-01T17:19:41.000Z 9529 libefi: efi_alloc_and_read should check for PMBR Reviewed by: Yuri Pankov <email@example.com> Reviewed by: Alexander Eremin <firstname.lastname@example.org> Approved by: Robert Mustacchi <email@example.com>