From 2383b2950b22aa275e146a7e15cb7b8b94ac58a6 Mon Sep 17 00:00:00 2001 From: Timo Warns Date: Thu, 26 May 2011 16:25:57 -0700 Subject: [PATCH] --- yaml --- r: 252062 b: refs/heads/master c: 3eb8e74ec72736b9b9d728bad30484ec89c91dde h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/partitions/efi.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f87e1b51b563..26d4489f2bb2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 658c74cf3c98b1c9bc21e26731052db66251dfd8 +refs/heads/master: 3eb8e74ec72736b9b9d728bad30484ec89c91dde diff --git a/trunk/fs/partitions/efi.c b/trunk/fs/partitions/efi.c index 19d6750d1d6c..6296b403c67a 100644 --- a/trunk/fs/partitions/efi.c +++ b/trunk/fs/partitions/efi.c @@ -310,6 +310,15 @@ static int is_gpt_valid(struct parsed_partitions *state, u64 lba, goto fail; } + /* Check the GUID Partition Table header size */ + if (le32_to_cpu((*gpt)->header_size) > + bdev_logical_block_size(state->bdev)) { + pr_debug("GUID Partition Table Header size is wrong: %u > %u\n", + le32_to_cpu((*gpt)->header_size), + bdev_logical_block_size(state->bdev)); + goto fail; + } + /* Check the GUID Partition Table CRC */ origcrc = le32_to_cpu((*gpt)->header_crc32); (*gpt)->header_crc32 = 0;