From 3b589c81480d7d3b0a90eff0c546454e893f58ba Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Tue, 18 Jan 2022 15:05:49 -0700 Subject: [PATCH] soc/amd/common/vboot: Verify the size of the transfer buffer This will verify that signed verstage binaries and the bootblock code executing agree on the transfer buffer struct size. BUG=b:213828947 TEST=Boot guybrush to OS Signed-off-by: Raul E Rangel Change-Id: I597e38fe0a37416ffd3bc01fd974fa8f6610a88c Reviewed-on: https://review.coreboot.org/c/coreboot/+/61187 Tested-by: build bot (Jenkins) Reviewed-by: Kangheui Won --- src/soc/amd/common/vboot/vboot_bootblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/soc/amd/common/vboot/vboot_bootblock.c b/src/soc/amd/common/vboot/vboot_bootblock.c index 06ac45ba5c..ae1a7d27a1 100644 --- a/src/soc/amd/common/vboot/vboot_bootblock.c +++ b/src/soc/amd/common/vboot/vboot_bootblock.c @@ -12,7 +12,7 @@ static int transfer_buffer_valid(const struct transfer_info_struct *ptr) { - if (ptr->magic_val == TRANSFER_MAGIC_VAL) + if (ptr->magic_val == TRANSFER_MAGIC_VAL && ptr->struct_bytes == sizeof(*ptr)) return 1; else return 0;