From 1a1cb5c9a38030a5868e2aaad295c68432c680fd Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Fri, 20 Jan 2023 12:54:13 +1100 Subject: 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 Signed-off-by: Edward O'Callaghan Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4181583 Reviewed-by: Evan Benn Reviewed-by: Julius Werner Auto-Submit: Edward O'Callaghan Tested-by: Edward O'Callaghan Commit-Queue: Edward O'Callaghan --- host/lib/flashrom_drv.c | 2 ++ 1 file changed, 2 insertions(+) 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, -- cgit v1.2.1