summaryrefslogtreecommitdiffstats
path: root/src/soc
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2022-01-18 15:05:49 -0700
committerRaul Rangel <rrangel@chromium.org>2022-01-20 18:06:48 +0000
commit3b589c81480d7d3b0a90eff0c546454e893f58ba (patch)
tree5ec84529328c81b17b7bc024f2ed392909af64c5 /src/soc
parent3625a126251ee13eb2ea0fa38f9cc32bc15356f0 (diff)
downloadcoreboot-3b589c81480d7d3b0a90eff0c546454e893f58ba.tar.gz
coreboot-3b589c81480d7d3b0a90eff0c546454e893f58ba.tar.bz2
coreboot-3b589c81480d7d3b0a90eff0c546454e893f58ba.zip
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 <rrangel@chromium.org> Change-Id: I597e38fe0a37416ffd3bc01fd974fa8f6610a88c Reviewed-on: https://review.coreboot.org/c/coreboot/+/61187 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kangheui Won <khwon@chromium.org>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/amd/common/vboot/vboot_bootblock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/soc/amd/common/vboot/vboot_bootblock.c b/src/soc/amd/common/vboot/vboot_bootblock.c
index 06ac45ba5cbb..ae1a7d27a177 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;