summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2023-11-06 16:51:27 -0800
committerJulius Werner <jwerner@chromium.org>2023-11-07 22:29:55 +0000
commit5bc5b1d02486acd7572d62b519642706b2872a37 (patch)
tree8778081f08514103e637b1ab7afc2b21d3c6f430 /src/lib
parentf9764707463ebc05015ede4e34665648bf741b7d (diff)
fmap: Map full FMAP for verification in fallback path
The rarely-used fallback path for accessing the FMAP without a cache currently only maps the FMAP header for the initial verify_fmap() call. This used to be fine when we were just checking the magic number, but with CBFS verification we may need to hash the entire FMAP. Since this path is so rarely used anyway and the size difference only has a practical impact on a few platforms, lets keep things simple and just always map the whole FMAP. Change-Id: Ie780a3662bf89637de93a36ce6e23f77fed86265 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78914 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/fmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/fmap.c b/src/lib/fmap.c
index 3889dd5f5d..ed186e0cae 100644
--- a/src/lib/fmap.c
+++ b/src/lib/fmap.c
@@ -122,7 +122,7 @@ static int find_fmap_directory(struct region_device *fmrd)
if (boot == NULL)
return -1;
- fmap = rdev_mmap(boot, offset, sizeof(struct fmap));
+ fmap = rdev_mmap(boot, offset, FMAP_SIZE);
if (fmap == NULL)
return -1;