summaryrefslogtreecommitdiffstats
path: root/util/cbfstool/cbfs_image.h
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2013-02-09 10:38:55 +0800
committerHung-Te Lin <hungte@chromium.org>2013-02-09 06:30:10 +0100
commit408aefd17645a95a0b1cac23b0ca7ad9c9df6925 (patch)
treeb6c1249ae72598925c0b4fe2dbc50defd4317735 /util/cbfstool/cbfs_image.h
parent1c270b155863e48a2b2a6d855c6b7ea2f38ef8c6 (diff)
downloadcoreboot-408aefd17645a95a0b1cac23b0ca7ad9c9df6925.tar.gz
coreboot-408aefd17645a95a0b1cac23b0ca7ad9c9df6925.tar.bz2
coreboot-408aefd17645a95a0b1cac23b0ca7ad9c9df6925.zip
cbfstool: Fix crash on image without bootblock in end of ROM.
On platforms with CBFS data filling end of ROM image without bootblock in the end (ex, ARM), calculation of "next valid entry" may exceed ROM image buffer in memory and raise segmentation fault when we try to compare its magic value. To fix this, always check if the entry address is inside ROM image buffer. Verified to build and boot successfully on qemu/x86 and armv7/snow. Change-Id: I117d6767a5403be636eea2b23be1dcf2e1c88839 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: http://review.coreboot.org/2330 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks <dhendrix@chromium.org>
Diffstat (limited to 'util/cbfstool/cbfs_image.h')
-rw-r--r--util/cbfstool/cbfs_image.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h
index 676efde98282..57bbfa17046f 100644
--- a/util/cbfstool/cbfs_image.h
+++ b/util/cbfstool/cbfs_image.h
@@ -114,7 +114,7 @@ struct cbfs_file *cbfs_find_next_entry(struct cbfs_image *image,
uint32_t cbfs_get_entry_addr(struct cbfs_image *image, struct cbfs_file *entry);
/* Returns 1 if entry has valid data (by checking magic number), otherwise 0. */
-int cbfs_is_valid_entry(struct cbfs_file *entry);
+int cbfs_is_valid_entry(struct cbfs_image *image, struct cbfs_file *entry);
/* Print CBFS component information. */
int cbfs_print_directory(struct cbfs_image *image);