From nobody Mon Feb 9 19:30:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+59595+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59595+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1589489559; cv=none; d=zohomail.com; s=zohoarc; b=LSrh5xmPJaXwCTwjKSQkTIFz2skiXEqbuZL3kyLK6eWwF6GkW03ILWcgYnPJv7opBtzS/cix7iz83exBPzVnx9dHi6Y2djTaLE0ZwKR6fJoweKGv1p7qQPcEWNcdBrcid99e8mFRPy/EeUEuPjCeTfWVMVSdFjqKUmfT/zRlCOw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589489559; h=Content-Type:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=KkW9hTzgZg16OAmTFjeC5ESiOIxptMQ6Ey6eWKrFZjw=; b=TgBCoe5+ndZiMSfbZ+cjTLtImZS6sZbRHzVN1iOpPvIB5aLd8YvvNG42exzo5LTKT9QKwGvX7JliaLm9f1mEdNzs0GBUQEkejwh68pwgENdmEAkrof6n8MYw8J0h+uBysCDW5AKGdBxnXHoKV/U6cFEoJHV4Jix7nMwFhYw6M00= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59595+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1589489559772963.650211037739; Thu, 14 May 2020 13:52:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id XhjTYY1788612x6j6RWARI1Q; Thu, 14 May 2020 13:52:39 -0700 X-Received: from atlmailgw1.ami.com (atlmailgw1.ami.com []) by mx.groups.io with SMTP id smtpd.web11.809.1589489553710474823 for ; Thu, 14 May 2020 13:52:39 -0700 X-AuditID: ac1060b2-0f7ff700000018d4-d1-5ebdaf966bae X-Received: from atlms1.us.megatrends.com (atlms1.us.megatrends.com [172.16.96.144]) (using TLS with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client did not present a certificate) by atlmailgw1.ami.com (Symantec Messaging Gateway) with SMTP id 51.77.06356.69FADBE5; Thu, 14 May 2020 16:52:38 -0400 (EDT) X-Received: from Oleksiy77.us.megatrends.com (172.16.97.158) by atlms1.us.megatrends.com (172.16.96.144) with Microsoft SMTP Server id 14.3.468.0; Thu, 14 May 2020 16:51:52 -0400 From: "Oleksiy Yakovlev" To: CC: , , , , , , , Subject: [edk2-devel] [PATCH V7 6/6] SignedCapsulePkg: Add FMP Capsule Image Header extension Date: Thu, 14 May 2020 16:51:45 -0400 Message-ID: <20200514205145.36956-7-oleksiyy@ami.com> In-Reply-To: <20200514205145.36956-1-oleksiyy@ami.com> References: <20200514205145.36956-1-oleksiyy@ami.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIIsWRmVeSWpSXmKPExsWyRiBhgu609XvjDP7+VbGY/7baon3CbDaL q7d+MVnM+zaD1WLdRw+LFfc2sFt0dPxjcmD32P79AqPH4j0vmQKYohoYbRLz8vJLEktSFVJS i5NtlQKKMssSkyuVFDJTbJUMlRQKchKTU3NT80pslRILClLzUpTsuBQwgA1QWWaeQmpecn5K Zl66rZJnsL+uhYWppa6hkl1IRqpCZl5aflFuYklmfp5Ccn5eCVB1agpQVCGhmzPj3Z+FjAWz xSquvp/H3MB4XKiLkZNDQsBE4sbbN8xdjFwcQgK7mCSmPdzMCuFsYZR4c/E6G0gVm4CmxIFj UxhBbBEBKYkpB2YygdjMAocZJTo+gcWFBYIljk++ARZnEVCV+HRkGwuIzStgKrH5zRlWiG0a EtPW3AWr4RQwk5j9/wiQzQG0zFTi6wQliHJBiZMzn7BAjJeQOPjiBTOILSQgK9F2/Dn7BEb+ WUjKZiEpW8DItIpRKLEkJzcxMye93FAvMTdTLzk/dxMjJP427WBsuWh+iJGJg/EQowQHs5II r9/63XFCvCmJlVWpRfnxRaU5qcWHGJ2A7p/ILMUNCkBgjMQbGxhIicI4hiZmJuZG5oaWJubG xkrivJPXrokTEkgHxmx2ampBahHMECYOTqkGRtm2lBdmyp+nrFgbP+ueuZJGktWSLy6eScq5 P+tmLF2oUJYdE2k90X7fVXX9R9afYs8dX/Lzh8fT/o07Z6/Vt+fYzKxmaPOTJ2fxiwOdiU12 zqm6ouUPb5mG5U5mDRe9bTxT/NbZ9+9P73fT10qYklusYGFW6GH1sM2rcfWZPZ+EBNaVbIvI UGIpzkg01GIuKk4EAEiD4CvUAgAA Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,oleksiyy@ami.com X-Gm-Message-State: kncI9xxcOKZf5RWSAAWLLFrSx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589489559; bh=Szx/8e+j3JzLO1t6qJ0LrZ/rHY97nG2sL9a86/BEpSU=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=G45QC2On9MbEA0v/lZojMn8G51hUpyxNwQXN8+4NZeoRXZUUEwPFabm4yEnUOAgBiiv kXHF9jg/l7/GFlAcIBCnw5c9uLmPkR1Q+16k4UA/ZmygJAMqcLCCk7oTzDHZnuPmv/5KM 0ZFRok9YwQx7MQX5ffXeLuWLV+kUh5HRgFQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add bitmask to structure which gives a binary-inspectable mechanism to determine if a capsule contains an authentication section or depex section. (UEFI 2.8 errata a, mantis 2026) Signed-off-by: Oleksiy Yakovlev Reviewed-by: Wei6 Xu Reviewed-by: Chao Zhang --- .../RecoveryModuleLoadPei/RecoveryModuleLoadPei.c | 18 ++++++++++++++= ---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/SignedCapsulePkg/Universal/RecoveryModuleLoadPei/RecoveryModul= eLoadPei.c b/SignedCapsulePkg/Universal/RecoveryModuleLoadPei/RecoveryModul= eLoadPei.c index 53b821c..12cc235 100644 --- a/SignedCapsulePkg/Universal/RecoveryModuleLoadPei/RecoveryModuleLoadPe= i.c +++ b/SignedCapsulePkg/Universal/RecoveryModuleLoadPei/RecoveryModuleLoadPe= i.c @@ -328,10 +328,15 @@ ValidateFmpCapsule ( DEBUG((DEBUG_ERROR, "ImageHeader->Version(0x%x) Unknown\n", ImageHea= der->Version)); return EFI_INVALID_PARAMETER; } - if (ImageHeader->Version < EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADE= R_INIT_VERSION) { + /// + /// Current Init ImageHeader version is 3. UpdateHardwareInstance fiel= d was added in version 2 + /// and ImageCapsuleSupport field was added in version 3 + /// + if (ImageHeader->Version =3D=3D 1) { FmpImageHeaderSize =3D OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMA= GE_HEADER, UpdateHardwareInstance); + } else { + FmpImageHeaderSize =3D OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMA= GE_HEADER, ImageCapsuleSupport); } - // No overflow if (FmpImageSize !=3D (UINT64)FmpImageHeaderSize + (UINT64)ImageHeader= ->UpdateImageSize + (UINT64)ImageHeader->UpdateVendorCodeSize) { DEBUG((DEBUG_ERROR, "FmpImageSize(0x%lx) mismatch, UpdateImageSize(0= x%x) UpdateVendorCodeSize(0x%x)\n", FmpImageSize, ImageHeader->UpdateImageS= ize, ImageHeader->UpdateVendorCodeSize)); @@ -639,9 +644,14 @@ ProcessFmpCapsuleImage ( } else { // // If the EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER is version 1,= only match ImageTypeId. - // Header should exclude UpdateHardwareInstance field + // Header should exclude UpdateHardwareInstance field. + // If version is 2 Header should exclude ImageCapsuleSupport field. // - Image =3D (UINT8 *)ImageHeader + OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_C= APSULE_IMAGE_HEADER, UpdateHardwareInstance); + if (ImageHeader->Version =3D=3D 1) { + Image =3D (UINT8 *)ImageHeader + OFFSET_OF(EFI_FIRMWARE_MANAGEMENT= _CAPSULE_IMAGE_HEADER, UpdateHardwareInstance); + } else { + Image =3D (UINT8 *)ImageHeader + OFFSET_OF(EFI_FIRMWARE_MANAGEMENT= _CAPSULE_IMAGE_HEADER, ImageCapsuleSupport); + } } =20 Status =3D ProcessRecoveryImage (Image, ImageHeader->UpdateImageSize); --=20 2.9.0.windows.1 Please consider the environment before printing this email. The information contained in this message may be confidential and proprieta= ry to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephon= e at 770-246-8600, and then delete or destroy all copies of the transmissio= n. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#59595): https://edk2.groups.io/g/devel/message/59595 Mute This Topic: https://groups.io/mt/74214499/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-