From 57ec204e69138f5ff46cf6712692213332a8599b Mon Sep 17 00:00:00 2001 From: "Zhang, Chao B" Date: Fri, 21 Jun 2019 10:24:10 +0800 Subject: Revert "Capsule-on-Disk entire Patch This reverts commit 0d4aa276d1f6e0cb9d71a7fb88b30c416ba6d5a3, 6470a43160183cd48cad8901c912a48811f18b13, fd7286089542ee7a98cfea00be45ceb3561e0b20, 7837d1249807b4248079699097bc993254235d7a, 6b32af2e105f9b5454a55b581f2dc365c5eb6397, 8636f70b5a763ed1c03b292708f9c5543e531ea9, f17935321a5b818a66e999632ef371b374b98f0c due to incorrect review process. Cc: Wei6 Xu Cc: Hao A Wu Signed-off-by: Zhang, Chao B Reviewed-by: Hao A Wu --- .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 57 +++++----------------- 1 file changed, 11 insertions(+), 46 deletions(-) (limited to 'MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c') diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c index 95aa9de..f38ab69 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c @@ -10,7 +10,7 @@ ValidateFmpCapsule(), and DisplayCapsuleImage() receives untrusted input and performs basic validation. - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -80,7 +80,6 @@ RecordCapsuleStatusVariable ( @param[in] PayloadIndex FMP payload index @param[in] ImageHeader FMP image header @param[in] FmpDevicePath DevicePath associated with the FMP producer - @param[in] CapFileName Capsule file name @retval EFI_SUCCESS The capsule status variable is recorded. @retval EFI_OUT_OF_RESOURCES No resource to record the capsule status variable. @@ -91,8 +90,7 @@ RecordFmpCapsuleStatusVariable ( IN EFI_STATUS CapsuleStatus, IN UINTN PayloadIndex, IN EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *ImageHeader, - IN EFI_DEVICE_PATH_PROTOCOL *FmpDevicePath, OPTIONAL - IN CHAR16 *CapFileName OPTIONAL + IN EFI_DEVICE_PATH_PROTOCOL *FmpDevicePath OPTIONAL ); /** @@ -112,22 +110,6 @@ UpdateImageProgress ( ); /** - Return if this capsule is a capsule name capsule, based upon CapsuleHeader. - - @param[in] CapsuleHeader A pointer to EFI_CAPSULE_HEADER - - @retval TRUE It is a capsule name capsule. - @retval FALSE It is not a capsule name capsule. -**/ -BOOLEAN -IsCapsuleNameCapsule ( - IN EFI_CAPSULE_HEADER *CapsuleHeader - ) -{ - return CompareGuid (&CapsuleHeader->CapsuleGuid, &gEdkiiCapsuleOnDiskNameGuid); -} - -/** Return if this CapsuleGuid is a FMP capsule GUID or not. @param[in] CapsuleGuid A pointer to EFI_GUID @@ -1052,12 +1034,11 @@ StartFmpImage ( /** Record FMP capsule status. - @param[in] Handle A FMP handle. + @param[in] Handle A FMP handle. @param[in] CapsuleHeader The capsule image header @param[in] CapsuleStatus The capsule process stauts @param[in] PayloadIndex FMP payload index @param[in] ImageHeader FMP image header - @param[in] CapFileName Capsule file name **/ VOID RecordFmpCapsuleStatus ( @@ -1065,8 +1046,7 @@ RecordFmpCapsuleStatus ( IN EFI_CAPSULE_HEADER *CapsuleHeader, IN EFI_STATUS CapsuleStatus, IN UINTN PayloadIndex, - IN EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *ImageHeader, - IN CHAR16 *CapFileName OPTIONAL + IN EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *ImageHeader ) { EFI_STATUS Status; @@ -1090,8 +1070,7 @@ RecordFmpCapsuleStatus ( CapsuleStatus, PayloadIndex, ImageHeader, - FmpDevicePath, - CapFileName + FmpDevicePath ); // @@ -1136,7 +1115,6 @@ RecordFmpCapsuleStatus ( This function need support nested FMP capsule. @param[in] CapsuleHeader Points to a capsule header. - @param[in] CapFileName Capsule file name. @param[out] ResetRequired Indicates whether reset is required or not. @retval EFI_SUCESS Process Capsule Image successfully. @@ -1148,7 +1126,6 @@ RecordFmpCapsuleStatus ( EFI_STATUS ProcessFmpCapsuleImage ( IN EFI_CAPSULE_HEADER *CapsuleHeader, - IN CHAR16 *CapFileName, OPTIONAL OUT BOOLEAN *ResetRequired OPTIONAL ) { @@ -1168,7 +1145,7 @@ ProcessFmpCapsuleImage ( BOOLEAN Abort; if (!IsFmpCapsuleGuid(&CapsuleHeader->CapsuleGuid)) { - return ProcessFmpCapsuleImage ((EFI_CAPSULE_HEADER *)((UINTN)CapsuleHeader + CapsuleHeader->HeaderSize), CapFileName, ResetRequired); + return ProcessFmpCapsuleImage ((EFI_CAPSULE_HEADER *)((UINTN)CapsuleHeader + CapsuleHeader->HeaderSize), ResetRequired); } NotReady = FALSE; @@ -1250,8 +1227,7 @@ ProcessFmpCapsuleImage ( CapsuleHeader, EFI_NOT_READY, Index - FmpCapsuleHeader->EmbeddedDriverCount, - ImageHeader, - CapFileName + ImageHeader ); continue; } @@ -1263,8 +1239,7 @@ ProcessFmpCapsuleImage ( CapsuleHeader, EFI_ABORTED, Index - FmpCapsuleHeader->EmbeddedDriverCount, - ImageHeader, - CapFileName + ImageHeader ); continue; } @@ -1287,8 +1262,7 @@ ProcessFmpCapsuleImage ( CapsuleHeader, Status, Index - FmpCapsuleHeader->EmbeddedDriverCount, - ImageHeader, - CapFileName + ImageHeader ); } if (HandleBuffer != NULL) { @@ -1440,13 +1414,6 @@ SupportCapsuleImage ( return EFI_SUCCESS; } - // - // Check capsule file name capsule - // - if (IsCapsuleNameCapsule(CapsuleHeader)) { - return EFI_SUCCESS; - } - if (IsFmpCapsule(CapsuleHeader)) { // // Fake capsule header is valid case in QueryCapsuleCpapbilities(). @@ -1469,7 +1436,6 @@ SupportCapsuleImage ( Caution: This function may receive untrusted input. @param[in] CapsuleHeader Points to a capsule header. - @param[in] CapFileName Capsule file name. @param[out] ResetRequired Indicates whether reset is required or not. @retval EFI_SUCESS Process Capsule Image successfully. @@ -1481,7 +1447,6 @@ EFI_STATUS EFIAPI ProcessThisCapsuleImage ( IN EFI_CAPSULE_HEADER *CapsuleHeader, - IN CHAR16 *CapFileName, OPTIONAL OUT BOOLEAN *ResetRequired OPTIONAL ) { @@ -1519,7 +1484,7 @@ ProcessThisCapsuleImage ( // Process EFI FMP Capsule // DEBUG((DEBUG_INFO, "ProcessFmpCapsuleImage ...\n")); - Status = ProcessFmpCapsuleImage(CapsuleHeader, CapFileName, ResetRequired); + Status = ProcessFmpCapsuleImage(CapsuleHeader, ResetRequired); DEBUG((DEBUG_INFO, "ProcessFmpCapsuleImage - %r\n", Status)); return Status; @@ -1546,7 +1511,7 @@ ProcessCapsuleImage ( IN EFI_CAPSULE_HEADER *CapsuleHeader ) { - return ProcessThisCapsuleImage (CapsuleHeader, NULL, NULL); + return ProcessThisCapsuleImage (CapsuleHeader, NULL); } /** -- cgit v1.1