Brian Norris has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/79060?usp=email )
Change subject: fmap: Drop invalid minor version check ......................................................................
fmap: Drop invalid minor version check
It's not valid to separately check the major and minor versions. The proper minor check would be something like:
if (fmap->ver_major == FMAP_VER_MAJOR && fmap->ver_minor > FMAP_VER_MINOR) ERROR();
But this code was alleged (at introduction in [1]) to have come from cbfstool, and cbfstool doesn't bother with a minor version check. This check is only for finding the FMAP while searching the flash; it isn't actually here for integrity and compatibility purpose.
Tested with a version of flashmap that claims a "version 0.3", but is otherwise compatible with this tooling.
[1] Commit c82900b66142 ("Add support to get layout from fmap (e.g. coreboot rom)")
BUG=b:288327526 TEST=libflashrom + ChromiumOS flashmap v0.3
Change-Id: I984835579d3b257a2462906f1f5091b179891bd0 Signed-off-by: Brian Norris briannorris@chromium.org --- M fmap.c 1 file changed, 0 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/60/79060/1
diff --git a/fmap.c b/fmap.c index 7f5df2b..a658203 100644 --- a/fmap.c +++ b/fmap.c @@ -54,8 +54,6 @@ /* strings containing the magic tend to fail here */ if (fmap->ver_major > FMAP_VER_MAJOR) return 0; - if (fmap->ver_minor > FMAP_VER_MINOR) - return 0; /* a basic consistency check: flash address space size should be larger * than the size of the fmap data structure */ if (fmap->size < fmap_size(fmap))