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 about 2 years ago
- % Done changed from 90 to 100
- Status changed from In Progress to Closed
commit fe12dc752b42da16028a16f4226e5295506fdb28 Author: Toomas Soome <email@example.com> Date: 2018-06-01T17:19:41.000Z 9529 libefi: efi_alloc_and_read should check for PMBR Reviewed by: Yuri Pankov <firstname.lastname@example.org> Reviewed by: Alexander Eremin <email@example.com> Approved by: Robert Mustacchi <firstname.lastname@example.org>