diff options
Diffstat (limited to 'fs/partitions')
-rw-r--r-- | fs/partitions/efi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c index 19d6750d1d6c..6296b403c67a 100644 --- a/fs/partitions/efi.c +++ b/fs/partitions/efi.c | |||
@@ -310,6 +310,15 @@ static int is_gpt_valid(struct parsed_partitions *state, u64 lba, | |||
310 | goto fail; | 310 | goto fail; |
311 | } | 311 | } |
312 | 312 | ||
313 | /* Check the GUID Partition Table header size */ | ||
314 | if (le32_to_cpu((*gpt)->header_size) > | ||
315 | bdev_logical_block_size(state->bdev)) { | ||
316 | pr_debug("GUID Partition Table Header size is wrong: %u > %u\n", | ||
317 | le32_to_cpu((*gpt)->header_size), | ||
318 | bdev_logical_block_size(state->bdev)); | ||
319 | goto fail; | ||
320 | } | ||
321 | |||
313 | /* Check the GUID Partition Table CRC */ | 322 | /* Check the GUID Partition Table CRC */ |
314 | origcrc = le32_to_cpu((*gpt)->header_crc32); | 323 | origcrc = le32_to_cpu((*gpt)->header_crc32); |
315 | (*gpt)->header_crc32 = 0; | 324 | (*gpt)->header_crc32 = 0; |