[SeaBIOS] [PATCH 2/3] tpm: Check length parameter of the array
Stefan Berger
stefanb at us.ibm.com
Mon Nov 30 05:49:42 CET 2015
From: Stefan Berger <stefanb at linux.vnet.ibm.com>
Check the length parameter that indicates the length of the array
for whether it has a minimum value of 0x200.
Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
---
src/tcgbios.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/tcgbios.c b/src/tcgbios.c
index c17d80d..285723c 100644
--- a/src/tcgbios.c
+++ b/src/tcgbios.c
@@ -766,6 +766,9 @@ tpm_add_bcv(u32 bootdrv, const u8 *addr, u32 length)
if (!has_working_tpm())
return TCG_GENERAL_ERROR;
+ if (length < 0x200)
+ return TCG_INVALID_INPUT_PARA;
+
const char *string = "Booting BCV device 00h (Floppy)";
if (bootdrv == 0x80)
string = "Booting BCV device 80h (HDD)";
--
2.4.3
More information about the SeaBIOS
mailing list