Commit 88b5ff36 authored by Timo Warns's avatar Timo Warns Committed by Greg Kroah-Hartman

Validate size of EFI GUID partition entries.

commit fa039d5f upstream.

Otherwise corrupted EFI partition tables can cause total confusion.
Signed-off-by: default avatarTimo Warns <warns@pre-sense.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b3f81536
......@@ -349,6 +349,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment