summaryrefslogtreecommitdiff
path: root/util/nvramtool/lbtable.c
diff options
context:
space:
mode:
authorTimothy Pearson <tpearson@raptorengineeringinc.com>2015-12-01 13:49:59 -0600
committerPatrick Georgi <pgeorgi@google.com>2015-12-02 17:32:07 +0100
commit347234c1ef0cb185df5da7c8fd5c2896cd269c2b (patch)
treee41ddc8346b93f2181f85c66ef13937da61c3622 /util/nvramtool/lbtable.c
parent8cf590fb1b5c998665879dd182476f327b693975 (diff)
downloadcoreboot-347234c1ef0cb185df5da7c8fd5c2896cd269c2b.tar.xz
util/nvramtool: Use correct virtual address when mapping tables
The existing code used a stale pointer from a previously unmapped region of memory when parsing the coreboot tables. Use the correct pointer from the currently mapped memory region when parsing. Change-Id: Id9a1c70655fe25bc079e5bee55f15adf674694f8 Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Reviewed-on: https://review.coreboot.org/12619 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/nvramtool/lbtable.c')
-rw-r--r--util/nvramtool/lbtable.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/nvramtool/lbtable.c b/util/nvramtool/lbtable.c
index 1c7bc0ab3d..5db61c507d 100644
--- a/util/nvramtool/lbtable.c
+++ b/util/nvramtool/lbtable.c
@@ -489,6 +489,9 @@ static const struct lb_header *lbtable_scan(unsigned long start,
}
map_pages(p, table->table_bytes + sizeof(*table));
+
+ table = (const struct lb_header *)phystov(p);
+
/* validate table checksum */
if (table->table_checksum !=
compute_ip_checksum(((char *)table) + sizeof(*table),