From d2a867217d63a5ef83c2877f842fd0e2c33259ba Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Thu, 9 Oct 2014 09:37:58 +0000 Subject: MdeModulePkg DxeCore: Add FVH signature check before VerifyFvHeaderChecksum in FwVol. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16200 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Dxe/FwVol/FwVol.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c index 4fa177ed7c..a7b272b4d6 100644 --- a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c @@ -658,6 +658,14 @@ NotifyFwVolBlock ( } ASSERT (FwVolHeader != NULL); + // + // Validate FV Header signature, if not as expected, continue. + // + if (FwVolHeader->Signature != EFI_FVH_SIGNATURE) { + CoreFreePool (FwVolHeader); + continue; + } + if (!VerifyFvHeaderChecksum (FwVolHeader)) { CoreFreePool (FwVolHeader); continue; -- cgit v1.2.3