mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
Validate size of EFI GUID partition entries.
commit fa039d5f6b upstream.
Otherwise corrupted EFI partition tables can cause total confusion.
Signed-off-by: Timo Warns <warns@pre-sense.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b3f815365f
commit
88b5ff36c0
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user