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 2E936D806D5 for ; Mon, 16 Oct 2023 13:18:25 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=HRT8XwfkX4yo79UXEJk+YXYbjHWelogSFKgSWHYXEjk=; 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=1697462303; v=1; b=ToNdD/V8H1DgGxVBNZM6g5QSvUWuonbX0EG4ZTzleeQFcxxLKQ3vspNk/rtDkl5Z8vkAC7po n+fzg68GmTCFeq165sTYsXpEF4fpaaFaCKOkkhhiKAVNiDeA8AZhpEwVPN33A0QVkjzqgMmxwQD wSsvnHeuV6fOVpwXZ/NVXTkQ= X-Received: by 127.0.0.2 with SMTP id Io9LYY7687511xg8ysVVOki6; Mon, 16 Oct 2023 06:18:23 -0700 X-Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by mx.groups.io with SMTP id smtpd.web10.123807.1697462302480388128 for ; Mon, 16 Oct 2023 06:18:22 -0700 X-Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2c518a1d83fso23425441fa.3 for ; Mon, 16 Oct 2023 06:18:22 -0700 (PDT) X-Gm-Message-State: 4IblUn3jcKtlybg1xf8UokVnx7686176AA= X-Google-Smtp-Source: AGHT+IGRGc+CNDfVZ6EF2FOzGlnNg+PGXM3WYEfuDJxZY3U+QxA3sCahzu4zG94ntsuG2wW5bHT5Fg== X-Received: by 2002:a2e:8e98:0:b0:2bf:f32a:1f68 with SMTP id z24-20020a2e8e98000000b002bff32a1f68mr30339110ljk.19.1697462300429; Mon, 16 Oct 2023 06:18:20 -0700 (PDT) X-Received: from PC10319.67 ([82.97.198.254]) by smtp.googlemail.com with ESMTPSA id 9-20020a2e1449000000b002ba586d27a2sm1362545lju.26.2023.10.16.06.18.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 06:18:20 -0700 (PDT) From: "Konstantin Aladyshev" To: devel@edk2.groups.io Cc: abner.chang@amd.com, isaac.w.oram@intel.com, AbdulLateef.Attar@amd.com, nicklew@nvidia.com, Konstantin Aladyshev Subject: [edk2-devel] [PATCH edk2-platforms 02/10] ManageabilityPkg: Check MCTP EIDs for reserved values Date: Mon, 16 Oct 2023 16:18:08 +0300 Message-Id: <20231016131816.6634-3-aladyshev22@gmail.com> In-Reply-To: <20231016131816.6634-1-aladyshev22@gmail.com> References: <20231016131816.6634-1-aladyshev22@gmail.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,aladyshev22@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="ToNdD/V8"; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) MTCP base specification marks EIDs 1-7 as reserved. Therefore return EFI_INVALID_PARAMETER if such EIDs were provided to the MctpSubmitMessage function. Signed-off-by: Konstantin Aladyshev Signed-off-by: Abner Chang --- .../Universal/MctpProtocol/Dxe/MctpProtocol.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProto= col.c b/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocol.c index 88bfd9b7e7..d0f49a1abb 100644 --- a/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocol.c +++ b/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocol.c @@ -78,6 +78,23 @@ MctpSubmitMessage ( return EFI_INVALID_PARAMETER;=0D }=0D =0D + //=0D + // Check source EID and destination EID=0D + //=0D + if ((MctpSourceEndpointId >=3D MCTP_RESERVED_ENDPOINT_START_ID) &&=0D + (MctpSourceEndpointId <=3D MCTP_RESERVED_ENDPOINT_END_ID)=0D + ) {=0D + DEBUG ((DEBUG_ERROR, "%a: The value of MCTP source EID (%x) is reserve= d.\n", __func__, MctpSourceEndpointId));=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + if ((MctpDestinationEndpointId >=3D MCTP_RESERVED_ENDPOINT_START_ID) &&= =0D + (MctpDestinationEndpointId <=3D MCTP_RESERVED_ENDPOINT_END_ID)=0D + ) {=0D + DEBUG ((DEBUG_ERROR, "%a: The value of MCTP destination EID (%x) is re= served.\n", __func__, MctpDestinationEndpointId));=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D Status =3D CommonMctpSubmitMessage (=0D mTransportToken,=0D MctpType,=0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109635): https://edk2.groups.io/g/devel/message/109635 Mute This Topic: https://groups.io/mt/101994939/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-