1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 14:11:15 +02:00

layout: Verify layout entries before building a new image using them

This fixes a SEGFAULT if a layout entry is included that addresses memory
outside the current chip's address range. flashrom will only abort if the
offending region(s) is/are included else it will just warn.

It will print warnings for regions with negative or zero-length address ranges
and bail out after checking all of them.

Also, abort for non-write operations if a layout file is given because there is
no layout support for other operations yet.

Corresponding to flashrom svn r1751.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
Stefan Tauner
2013-09-23 14:21:06 +00:00
parent a6a0d2000a
commit 8268fdb902
4 changed files with 52 additions and 8 deletions

View File

@ -370,6 +370,12 @@ int main(int argc, char *argv[])
ret = 1;
goto out;
}
if (layoutfile != NULL && !write_it) {
msg_gerr("Layout files are currently supported for write operations only.\n");
ret = 1;
goto out;
}
if (process_include_args()) {
ret = 1;
goto out;