Message ID | 1316000900-1542-2-git-send-email-apw@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c index 46e9f47..9e86a34 100644 --- a/fs/partitions/efi.c +++ b/fs/partitions/efi.c @@ -360,6 +360,12 @@ is_gpt_valid(struct block_device *bdev, u64 lba, goto fail; } + /* Check that sizeof_partition_entry has the correct value */ + if (le32_to_cpu((*gpt)->sizeof_partition_entry) != sizeof(gpt_entry)) { + pr_debug("GUID Partitition Entry Size check failed.\n"); + goto fail; + } + if (!(*ptes = alloc_read_gpt_entries(bdev, *gpt))) goto fail;