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 25F76AC0BA6 for ; Tue, 19 Dec 2023 04:50:28 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=q4OesfDKFzGt+2AhgmzOvWqU1/X7EbCOThurlzFxc20=; 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=1702961427; v=1; b=MpuGNF94WHb55D5Ia069GBdsoBc2tlNiPpNN/55nJ1MmudyTNJn36TACOUEqBFHbnmw/s6FJ /eY5gS/eMeGJ9/d1M5kmlp4n+oZ5su+Yb+itbxWJPMwtxOuomZJLo4gNzSHpqVRl6FiOqYETchN ABDKI/0oAeCsnpNEmVkvoEwU= X-Received: by 127.0.0.2 with SMTP id 8Fs4YY7687511xFnn5FT8Z7I; Mon, 18 Dec 2023 20:50:27 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.5762.1702961425788074891 for ; Mon, 18 Dec 2023 20:50:27 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10928"; a="481798134" X-IronPort-AV: E=Sophos;i="6.04,287,1695711600"; d="scan'208";a="481798134" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2023 20:50:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10928"; a="841752582" X-IronPort-AV: E=Sophos;i="6.04,287,1695711600"; d="scan'208";a="841752582" X-Received: from liyi4-desktop.ccr.corp.intel.com ([10.239.153.29]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2023 20:50:25 -0800 From: "Li, Yi" To: devel@edk2.groups.io Cc: Yi Li , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH 1/2] MdePkg: Add DECLARE_LENGTH opcode of dependency expression Date: Tue, 19 Dec 2023 12:50:12 +0800 Message-ID: <20231219045013.1425-2-yi1.li@intel.com> In-Reply-To: <20231219045013.1425-1-yi1.li@intel.com> References: <20231219045013.1425-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: hmeRxo5o6HsodICfvrDgToKYx7686176AA= 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=MpuGNF94; 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 Mantis: https://mantis.uefi.org/mantis/view.php?id=2025 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. 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 (#112687): https://edk2.groups.io/g/devel/message/112687 Mute This Topic: https://groups.io/mt/103257908/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-