summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2023-01-20 12:54:13 +1100
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-29 08:18:53 +0000
commit8119617844689382e3bf986ea6f417797fef663a (patch)
treea76e21ce28bed83c28e478dce16e087ff885007d
parent58fdd0a26bb9fb3f0062b9267461057762b2e2fd (diff)
downloadvboot-8119617844689382e3bf986ea6f417797fef663a.tar.gz
futility/flashrom_drv: Add new skip perm flags to read path
flashrom now respects region permissions rather than ignoring exit codes. While downstreaming this support we require these flags to be set to ensure no change in behavior for futility. It turns out chromeos-firmware-updater will fail on the read path with, ``` [..] read_flash: cannot read inside Management Engine region (0x001000..0x1fffff). Read operation failed! ERROR: do_update: Cannot load system active firmware. ``` without skipping regions that cannot actually be read. BUG=b:260440773 BRANCH=none TEST=builds Change-Id: I45a5b81837988fab18b1c392415dffe55ad49822 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4181583 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4380960 Reviewed-by: Cheng Yueh <cyueh@chromium.org> Commit-Queue: Cheng Yueh <cyueh@chromium.org> Auto-Submit: Phoebe Wang <phoebewang@chromium.org> Tested-by: Phoebe Wang <phoebewang@chromium.org>
-rw-r--r--host/lib/flashrom_drv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/host/lib/flashrom_drv.c b/host/lib/flashrom_drv.c
index 60cabc04..a9889cc9 100644
--- a/host/lib/flashrom_drv.c
+++ b/host/lib/flashrom_drv.c
@@ -77,6 +77,8 @@ static int flashrom_read_image_impl(struct firmware_image *image,
len = flashrom_flash_getsize(flashctx);
+ flashrom_flag_set(flashctx, FLASHROM_FLAG_SKIP_UNREADABLE_REGIONS, true);
+
if (region) {
r = flashrom_layout_read_fmap_from_buffer(
&layout, flashctx, (const uint8_t *)image->data,