Attention is currently required from: Anastasia Klimchuk, Brian Norris, Hsuan-ting Chen.

Brian Norris uploaded patch set #3 to this change.

View Change

The following approvals got outdated and were removed: Code-Review+1 by Anastasia Klimchuk, Code-Review+2 by Hsuan-ting Chen, Verified+1 by build bot (Jenkins)

fmap: Update major/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.

Drop the MINOR version check; align with cbfstool on the MAJOR version
check; and match the cbfstool comments for is_valid_fmap(), to emphasize
the lack of precision.

[1] Commit c82900b66142 ("Add support to get layout from fmap (e.g.
coreboot rom)")

BRANCH=none
BUG=b:288327526
TEST=libflashrom + ChromiumOS flashmap

Change-Id: I984835579d3b257a2462906f1f5091b179891bd0
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
M fmap.c
1 file changed, 2 insertions(+), 3 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/60/79060/3

To view, visit change 79060. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I984835579d3b257a2462906f1f5091b179891bd0
Gerrit-Change-Number: 79060
Gerrit-PatchSet: 3
Gerrit-Owner: Brian Norris <briannorris@chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Hsuan-ting Chen <roccochen@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Hsuan Ting Chen <roccochen@chromium.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Attention: Brian Norris <briannorris@chromium.org>
Gerrit-Attention: Hsuan-ting Chen <roccochen@google.com>
Gerrit-Attention: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-MessageType: newpatchset