Yu-Ping Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36844 )
Change subject: security/vboot: Remove buffer_size from struct vboot_working_data ......................................................................
security/vboot: Remove buffer_size from struct vboot_working_data
Since buffer_size is no longer used, remove it from struct vboot_working_data.
BRANCH=none BUG=chromium:1021452 TEST=emerge-kukui coreboot
Change-Id: Ie770e89b4a45e0ec703d5bbb8fb6a298ce915056 Signed-off-by: Yu-Ping Wu yupingso@chromium.org --- M src/lib/coreboot_table.c M src/security/vboot/common.c M src/security/vboot/misc.h 3 files changed, 8 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/36844/1
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c index d3576e6..709bb0d 100644 --- a/src/lib/coreboot_table.c +++ b/src/lib/coreboot_table.c @@ -227,7 +227,12 @@ vbwb->tag = LB_TAG_VBOOT_WORKBUF; vbwb->size = sizeof(*vbwb); vbwb->range_start = (uintptr_t)wd + wd->buffer_offset; - vbwb->range_size = wd->buffer_size; + /* + * TODO(chromium:1021452) + * This value being zero doesn't cause any problems, since it is never + * read downstream. Fix or deprecate vboot_working_data. + */ + vbwb->range_size = 0; }
__weak uint32_t board_id(void) { return UNDEFINED_STRAPPING_ID; } diff --git a/src/security/vboot/common.c b/src/security/vboot/common.c index 043748c..ea22bdf 100644 --- a/src/security/vboot/common.c +++ b/src/security/vboot/common.c @@ -73,11 +73,11 @@ */ memset(wd, 0, sizeof(*wd)); wd->buffer_offset = ALIGN_UP(sizeof(*wd), 16); - wd->buffer_size = VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE + const uint16_t size = VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE - wd->buffer_offset;
/* Initialize vb2_shared_data and friends. */ - assert(vb2api_init(vboot_get_workbuf(wd), wd->buffer_size, + assert(vb2api_init(vboot_get_workbuf(wd), size, vboot_ctx_ptr) == VB2_SUCCESS);
return *vboot_ctx_ptr; @@ -137,14 +137,6 @@ cbmem_add(CBMEM_ID_VBOOT_WORKBUF, cbmem_size); assert(wd_cbmem != NULL); memcpy(wd_cbmem, wd_preram, sizeof(struct vboot_working_data)); - /* - * TODO(chromium:1021452): buffer_size is uint16_t and not large enough - * to hold the kernel verification workbuf size. The only code which - * reads this value is in lb_vboot_workbuf() for lb_range->range_size. - * This value being zero doesn't cause any problems, since it is never - * read downstream. Fix or deprecate vboot_working_data. - */ - wd_cbmem->buffer_size = 0; vb2api_relocate(vboot_get_workbuf(wd_cbmem), vboot_get_workbuf(wd_preram), cbmem_size - wd_cbmem->buffer_offset, diff --git a/src/security/vboot/misc.h b/src/security/vboot/misc.h index 455773c..6141674 100644 --- a/src/security/vboot/misc.h +++ b/src/security/vboot/misc.h @@ -39,7 +39,6 @@ struct selected_region selected_region; /* offset of the buffer from the start of this struct */ uint16_t buffer_offset; - uint16_t buffer_size; };
/*