Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359393
b: refs/heads/master
c: 8b8a6e1
h: refs/heads/master
i:
  359391: 0bfa4a8
v: v3
  • Loading branch information
Peter Jones authored and Linus Torvalds committed Feb 28, 2013
1 parent 138e7f5 commit 264b59b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 86ee8ba64daf5e09a71e4c216f81fae8d1c937f3
refs/heads/master: 8b8a6e1881be8d73b7a98f84ccec61e624ec5cac
12 changes: 10 additions & 2 deletions trunk/block/partitions/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,23 @@ static int is_gpt_valid(struct parsed_partitions *state, u64 lba,
goto fail;
}

/* Check the GUID Partition Table header size */
/* Check the GUID Partition Table header size is too big */
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",
pr_debug("GUID Partition Table Header size is too large: %u > %u\n",
le32_to_cpu((*gpt)->header_size),
bdev_logical_block_size(state->bdev));
goto fail;
}

/* Check the GUID Partition Table header size is too small */
if (le32_to_cpu((*gpt)->header_size) < sizeof(gpt_header)) {
pr_debug("GUID Partition Table Header size is too small: %u < %zu\n",
le32_to_cpu((*gpt)->header_size),
sizeof(gpt_header));
goto fail;
}

/* Check the GUID Partition Table CRC */
origcrc = le32_to_cpu((*gpt)->header_crc32);
(*gpt)->header_crc32 = 0;
Expand Down

0 comments on commit 264b59b

Please sign in to comment.