Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31891
Change subject: util/amdfwtool: Allow 0-length blobs ......................................................................
util/amdfwtool: Allow 0-length blobs
A side effect of the change 8e0dca05 "util/amdfwtool: Add generic image copy function" was to treat a read operation of zero bytes as a failure. Some implementations exist that use zero length files as a means of removing functionality. This causes amdfwtool to exit with an error.
Put the zero length capability back in, and generate the requested table entry with a length field of 0x0.
Change-Id: Ifc9204dbbf6b107f06116362358ab9d22caa71df Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M util/amdfwtool/amdfwtool.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/31891/1
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 376887c..4a13b29 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -424,7 +424,7 @@
bytes = copy_blob(BUFF_CURRENT(*ctx), fw_table[i].filename, BUFF_ROOM(*ctx)); - if (bytes <= 0) { + if (bytes < 0) { free(ctx->rom); exit(1); } @@ -455,7 +455,7 @@ } else if (fw_table[i].filename != NULL) { bytes = copy_blob(BUFF_CURRENT(*ctx), fw_table[i].filename, BUFF_ROOM(*ctx)); - if (bytes <= 0) { + if (bytes < 0) { free(ctx->rom); exit(1); }
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31891
to look at the new patch set (#2).
Change subject: util/amdfwtool: Allow 0-length blobs ......................................................................
util/amdfwtool: Allow 0-length blobs
A side effect of the change 8e0dca05 "util/amdfwtool: Add generic image copy function" was to treat a read operation of zero bytes as a failure. Some implementations exist that use zero length files as a means of removing functionality. This causes amdfwtool to exit with an error.
Put the zero length capability back in, and generate the requested table entry with a length field of 0x0.
TEST=Boot google/grunt, inspect PSP directory table BUG=b:128507639
Change-Id: Ifc9204dbbf6b107f06116362358ab9d22caa71df Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M util/amdfwtool/amdfwtool.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/31891/2
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31891 )
Change subject: util/amdfwtool: Allow 0-length blobs ......................................................................
Patch Set 2: Code-Review+2
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31891 )
Change subject: util/amdfwtool: Allow 0-length blobs ......................................................................
Patch Set 2: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31891 )
Change subject: util/amdfwtool: Allow 0-length blobs ......................................................................
util/amdfwtool: Allow 0-length blobs
A side effect of the change 8e0dca05 "util/amdfwtool: Add generic image copy function" was to treat a read operation of zero bytes as a failure. Some implementations exist that use zero length files as a means of removing functionality. This causes amdfwtool to exit with an error.
Put the zero length capability back in, and generate the requested table entry with a length field of 0x0.
TEST=Boot google/grunt, inspect PSP directory table BUG=b:128507639
Change-Id: Ifc9204dbbf6b107f06116362358ab9d22caa71df Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/31891 Reviewed-by: Patrick Georgi pgeorgi@google.com Reviewed-by: Martin Roth martinroth@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M util/amdfwtool/amdfwtool.c 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved Martin Roth: Looks good to me, approved
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 376887c..4a13b29 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -424,7 +424,7 @@
bytes = copy_blob(BUFF_CURRENT(*ctx), fw_table[i].filename, BUFF_ROOM(*ctx)); - if (bytes <= 0) { + if (bytes < 0) { free(ctx->rom); exit(1); } @@ -455,7 +455,7 @@ } else if (fw_table[i].filename != NULL) { bytes = copy_blob(BUFF_CURRENT(*ctx), fw_table[i].filename, BUFF_ROOM(*ctx)); - if (bytes <= 0) { + if (bytes < 0) { free(ctx->rom); exit(1); }