Messages in this thread Patch in this message |  | | | Date | Thu, 19 May 2011 11:04:34 -0700 | | From | Greg KH <> | | Subject | [06/71] Validate size of EFI GUID partition entries. |
| |
2.6.38-stable review patch. If anyone has any objections, please let us know.
------------------ From: Timo Warns <Warns@pre-sense.de>
commit fa039d5f6b126fbd65eefa05db2f67e44df8f121 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>
--- fs/partitions/efi.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/fs/partitions/efi.c +++ b/fs/partitions/efi.c @@ -348,6 +348,12 @@ static int is_gpt_valid(struct parsed_pa 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(state, *gpt))) goto fail;
|  |