Date
1 - 3 of 3
[PATCH V1 1/1] OvmfPkg/PlatformInitLib: Add check to NvVarStoreFV HeaderLength
Yao, Jiewen
toggle quoted message
Show quoted text
-----Original Message----- |
|
Yao, Jiewen
Reviewed-by: Jiewen Yao <Jiewen.yao@...>
toggle quoted message
Show quoted text
-----Original Message----- |
|
Min Xu
From: Min M Xu <min.m.xu@...>
There should be a check that the FV HeaderLength cannot be an odd number. Otherwise in the following CalculateSum16 there would be an ASSERT. In ValidateFvHeader@QemuFlashFvbServicesRuntimeDxe/FwBlockServices.c there a is similar check to the FwVolHeader->HeaderLength. Cc: Erdem Aktas <erdemaktas@...> Cc: James Bottomley <jejb@...> Cc: Jiewen Yao <jiewen.yao@...> Cc: Gerd Hoffmann <kraxel@...> Cc: Tom Lendacky <thomas.lendacky@...> Signed-off-by: Min Xu <min.m.xu@...> --- OvmfPkg/Library/PlatformInitLib/Platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c b/OvmfPkg/Library/PlatformInitLib/Platform.c index 2582689ffe35..77f22de046f2 100644 --- a/OvmfPkg/Library/PlatformInitLib/Platform.c +++ b/OvmfPkg/Library/PlatformInitLib/Platform.c @@ -653,6 +653,7 @@ PlatformValidateNvVarStore ( (!CompareGuid (&FvHdrGUID, &NvVarStoreFvHeader->FileSystemGuid)) || (NvVarStoreFvHeader->Signature != EFI_FVH_SIGNATURE) || (NvVarStoreFvHeader->Attributes != 0x4feff) || + ((NvVarStoreFvHeader->HeaderLength & 0x01) != 0) || (NvVarStoreFvHeader->Revision != EFI_FVH_REVISION) || (NvVarStoreFvHeader->FvLength != NvVarStoreSize) ) -- 2.29.2.windows.2 |
|