From 005a9c32df9dc0cb9dd5e1133fee49845c70fc67 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 28 Feb 2013 13:16:39 +0100 Subject: [PATCH] * grub-core/kern/i386/coreboot/mmap.c (grub_linuxbios_table_iterate): Fix end of table condition. --- ChangeLog | 5 +++++ grub-core/kern/i386/coreboot/mmap.c | 6 ++++-- include/grub/i386/coreboot/lbio.h | 8 ++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 21ec9a9a6..0eb0516a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-02-28 Vladimir Serbinenko + + * grub-core/kern/i386/coreboot/mmap.c (grub_linuxbios_table_iterate): + Fix end of table condition. + 2013-02-28 Vladimir Serbinenko * grub-core/lib/arg.c (grub_arg_show_help): Move showargs diff --git a/grub-core/kern/i386/coreboot/mmap.c b/grub-core/kern/i386/coreboot/mmap.c index ae4af083c..47efb723d 100644 --- a/grub-core/kern/i386/coreboot/mmap.c +++ b/grub-core/kern/i386/coreboot/mmap.c @@ -58,8 +58,10 @@ signature_found: table_item = (grub_linuxbios_table_item_t) ((long) table_header + - (long) table_header->size); - for (; table_item->size; + (long) table_header->header_size); + for (; table_item < (grub_linuxbios_table_item_t) ((long) table_header + + (long) table_header->header_size + + (long) table_header->table_size); table_item = (grub_linuxbios_table_item_t) ((long) table_item + (long) table_item->size)) { if (table_item->tag == GRUB_LINUXBIOS_MEMBER_LINK diff --git a/include/grub/i386/coreboot/lbio.h b/include/grub/i386/coreboot/lbio.h index aa1853933..bac549247 100644 --- a/include/grub/i386/coreboot/lbio.h +++ b/include/grub/i386/coreboot/lbio.h @@ -22,8 +22,12 @@ struct grub_linuxbios_table_header { - char signature[4]; - grub_uint32_t size; + grub_uint8_t signature[4]; + grub_uint32_t header_size; + grub_uint32_t header_checksum; + grub_uint32_t table_size; + grub_uint32_t table_checksum; + grub_uint32_t table_entries; }; typedef struct grub_linuxbios_table_header *grub_linuxbios_table_header_t;