]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg PeiCore: Fix issue AuthenticationStatus is not propagated correctly
authorEugene Cohen <eugene@hp.com>
Tue, 10 Nov 2015 10:02:24 +0000 (10:02 +0000)
committerlzeng14 <lzeng14@Edk2>
Tue, 10 Nov 2015 10:02:24 +0000 (10:02 +0000)
This patch fixes an issue in PEI with encapsulated FV images where the
AuthenticationStatus is not correctly propagated down to child FV
handles.  The PEI core registers for callbacks for both FvInfo and
FvInfo2 PPIs.  These callbacks process the FVs which will recurse as
necessary to find more encapsulated FVs.  (FvInfo2 is an updated PPI
that includes an AuthenticationStatus field - the original FvInfo did
not include this.)

When encapsulated FV processing occurs the PEI core installs both
FvInfo and FvInfo2 PPIs.  The original implementation installs FvInfo
first and FvInfo2 second.  As soon as the FvInfo PPI is installed the
notification callback handler immediately fires causing recursive FV
processing to occur.  Since there is no AuthenticationStatus provided
for the original FvInfo the callback assumes AuthenticationStatus is
zero (unsigned / unverified) even though the parent FV may have been
verified.

This changes the order of FvInfo and FvInfo2 installs to ensure that
the notification callback occurs for FvInfo2 first and appropriate
AuthenticationStatus data can be propagated from parent FV to child
FV.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18764 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Pei/FwVol/FwVol.c

index 363ff7e694a2321d48010ef1dc1dc8ace630e03b..8f6e2efcecaa9cf0247be296d85cb7b98f196888 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Pei Core Firmware File System service routines.\r
   \r
+Copyright (c) 2015 HP Development Company, L.P.\r
 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
@@ -1381,22 +1382,24 @@ ProcessFvFile (
   \r
   //\r
   // Install FvInfo(2) Ppi\r
+  // NOTE: FvInfo2 must be installed before FvInfo so that recursive processing of encapsulated\r
+  // FVs inherit the proper AuthenticationStatus.\r
   //\r
-  PeiServicesInstallFvInfoPpi (\r
+  PeiServicesInstallFvInfo2Ppi(\r
     &FvHeader->FileSystemGuid,\r
-    (VOID**) FvHeader,\r
-    (UINT32) FvHeader->FvLength,\r
+    (VOID**)FvHeader,\r
+    (UINT32)FvHeader->FvLength,\r
     &ParentFvImageInfo.FvName,\r
-    &FileInfo.FileName\r
+    &FileInfo.FileName,\r
+    AuthenticationStatus\r
     );\r
 \r
-  PeiServicesInstallFvInfo2Ppi (\r
+  PeiServicesInstallFvInfoPpi (\r
     &FvHeader->FileSystemGuid,\r
     (VOID**) FvHeader,\r
     (UINT32) FvHeader->FvLength,\r
     &ParentFvImageInfo.FvName,\r
-    &FileInfo.FileName,\r
-    AuthenticationStatus\r
+    &FileInfo.FileName\r
     );\r
 \r
   //\r