util/smmstoretool: Ensure that the FVB header isn't too large
If the header size is equal to fv.length, then `fv_parse()` will go out-of-bounds when obtaining the variable store data, and obviously, there is no data if the header takes up all available space. Change-Id: I0ac46e098a14b51f936cb99f5e6bf83411570bc5 Signed-off-by: Benjamin Doron <benjamin.doron@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/88452 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
This commit is contained in:
parent
a6fbaa47ea
commit
b49f567e45
1 changed files with 1 additions and 1 deletions
|
|
@ -100,7 +100,7 @@ static bool check_fw_vol_hdr(const EFI_FIRMWARE_VOLUME_HEADER *hdr,
|
|||
if (hdr->Revision != EFI_FVH_REVISION ||
|
||||
hdr->Signature != EFI_FVH_SIGNATURE ||
|
||||
hdr->FvLength > max_size ||
|
||||
hdr->HeaderLength > max_size ||
|
||||
hdr->HeaderLength >= max_size ||
|
||||
hdr->HeaderLength % 2 != 0) {
|
||||
fprintf(stderr, "No firmware volume header present\n");
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue