From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id DF497940A11 for ; Wed, 20 Dec 2023 01:55:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dypSstI01YeVQN4CFVU5rA2gwxWD0EInzD7Y5L2+w98=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1703037314; v=1; b=actPH5iBbKJBiLO4/bAvnV4uNct0ZFW3OYnSWFdFo2Tz8lxLlZUQMFXrgdn8is1kX1CwLvZE tUGqXcvQxKbwWkN8JvSKXxy68NtC9j5dmZV4nEItP8Nqm2f9eBPLMNygiITyzeHupP8Z2Ba3uUZ IG0D8moge63+Khn/f5/phDH4= X-Received: by 127.0.0.2 with SMTP id DiWOYY7687511xazkRLIabER; Tue, 19 Dec 2023 17:55:14 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.12738.1703037312815796096 for ; Tue, 19 Dec 2023 17:55:14 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10929"; a="386173339" X-IronPort-AV: E=Sophos;i="6.04,290,1695711600"; d="scan'208";a="386173339" X-Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2023 17:55:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10929"; a="776165839" X-IronPort-AV: E=Sophos;i="6.04,290,1695711600"; d="scan'208";a="776165839" X-Received: from liyi4-desktop.ccr.corp.intel.com ([10.239.153.29]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2023 17:55:10 -0800 From: "Li, Yi" To: devel@edk2.groups.io Cc: Yi Li , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH V2 1/2] MdePkg: Add DECLARE_LENGTH opcode of dependency expression Date: Wed, 20 Dec 2023 09:54:54 +0800 Message-ID: <20231220015455.1636-2-yi1.li@intel.com> In-Reply-To: <20231220015455.1636-1-yi1.li@intel.com> References: <20231220015455.1636-1-yi1.li@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: 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,yi1.li@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: X1drQkPKRv2oKVpuYlk96m6tx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=actPH5iB; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io To avoid messy parsing of the Depex section of a Capsule, it would be a lot easier for everyone involved if we preceded the Capsule Depex Section with a length declaration. It provides simple bounds checking to avoid having to parse the op-codes, but in the case of a malformed depex being parsed, avoid other issues which can be messy. Syntax DECLARE_LENGTH <32-bit Length> Description Declares an 32-bit byte length of the entire dependency expression. Behaviors and Restrictions This opcode must be the first one in a dependency expression. REF: UEFI spec 2.10 Table 23.4 Signed-off-by: Yi Li Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu --- MdePkg/Include/Protocol/FirmwareManagement.h | 29 ++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/MdePkg/Include/Protocol/FirmwareManagement.h b/MdePkg/Include/Protocol/FirmwareManagement.h index f37067df3455..e535bb697d88 100644 --- a/MdePkg/Include/Protocol/FirmwareManagement.h +++ b/MdePkg/Include/Protocol/FirmwareManagement.h @@ -30,20 +30,21 @@ typedef struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL EFI_FIRMWARE_MANAGEMENT_PROTOCO /// /// Dependency Expression Opcode /// -#define EFI_FMP_DEP_PUSH_GUID 0x00 -#define EFI_FMP_DEP_PUSH_VERSION 0x01 -#define EFI_FMP_DEP_VERSION_STR 0x02 -#define EFI_FMP_DEP_AND 0x03 -#define EFI_FMP_DEP_OR 0x04 -#define EFI_FMP_DEP_NOT 0x05 -#define EFI_FMP_DEP_TRUE 0x06 -#define EFI_FMP_DEP_FALSE 0x07 -#define EFI_FMP_DEP_EQ 0x08 -#define EFI_FMP_DEP_GT 0x09 -#define EFI_FMP_DEP_GTE 0x0A -#define EFI_FMP_DEP_LT 0x0B -#define EFI_FMP_DEP_LTE 0x0C -#define EFI_FMP_DEP_END 0x0D +#define EFI_FMP_DEP_PUSH_GUID 0x00 +#define EFI_FMP_DEP_PUSH_VERSION 0x01 +#define EFI_FMP_DEP_VERSION_STR 0x02 +#define EFI_FMP_DEP_AND 0x03 +#define EFI_FMP_DEP_OR 0x04 +#define EFI_FMP_DEP_NOT 0x05 +#define EFI_FMP_DEP_TRUE 0x06 +#define EFI_FMP_DEP_FALSE 0x07 +#define EFI_FMP_DEP_EQ 0x08 +#define EFI_FMP_DEP_GT 0x09 +#define EFI_FMP_DEP_GTE 0x0A +#define EFI_FMP_DEP_LT 0x0B +#define EFI_FMP_DEP_LTE 0x0C +#define EFI_FMP_DEP_END 0x0D +#define EFI_FMP_DEP_DECLARE_LENGTH 0x0E /// /// Image Attribute - Dependency -- 2.42.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112738): https://edk2.groups.io/g/devel/message/112738 Mute This Topic: https://groups.io/mt/103274337/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-