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 25AADAC0F8F for ; Mon, 23 Oct 2023 13:05:22 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ouPrOzTflf0spwhqdL2RereFZBbnqOOxY42IxbFDDtA=; 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=1698066320; v=1; b=JMHLjfZWnh9aOU3dSiBGlM4wsxkmB0gQjs4gyGA7OCw2WWl1LJRyS/WGJ5R1qWBOTW3ZSwly nav75+l2+ds++c7ZrmDHlgw/hpey/+UCMbcu+ZwdkfjPmGdGoEoEiZM0r+JYr5M40gldkKJ2EYe 9agvj0h2Jkwg79wV3yetKZdU= X-Received: by 127.0.0.2 with SMTP id BJtKYY7687511x7AcP2hpkk7; Mon, 23 Oct 2023 06:05:20 -0700 X-Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mx.groups.io with SMTP id smtpd.web10.119842.1698066319386766690 for ; Mon, 23 Oct 2023 06:05:19 -0700 X-Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2c5028e5b88so46300251fa.3 for ; Mon, 23 Oct 2023 06:05:19 -0700 (PDT) X-Gm-Message-State: MKBR3ZlT7xZOpPCUnGyY3iFWx7686176AA= X-Google-Smtp-Source: AGHT+IGu80jxTMGGCddaFXONM/2yfegFtERBU6gcdFTr+beC8hCtIybfF94TIHBuLVmbFYw6P7ZbSw== X-Received: by 2002:a2e:9b06:0:b0:2bc:c4af:36b9 with SMTP id u6-20020a2e9b06000000b002bcc4af36b9mr6380863lji.52.1698066317164; Mon, 23 Oct 2023 06:05:17 -0700 (PDT) X-Received: from PC10319.67 ([82.97.198.254]) by smtp.googlemail.com with ESMTPSA id r11-20020a2e994b000000b002b9e0d19644sm1550081ljj.106.2023.10.23.06.05.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:05:16 -0700 (PDT) From: "Konstantin Aladyshev" To: devel@edk2.groups.io Cc: abner.chang@amd.com, AbdulLateef.Attar@amd.com, nicklew@nvidia.com, Konstantin Aladyshev Subject: [edk2-devel] [PATCH edk2-platforms v3 02/16] ManageabilityPkg: Check MCTP EIDs for reserved values Date: Mon, 23 Oct 2023 16:04:57 +0300 Message-Id: <20231023130511.4521-3-aladyshev22@gmail.com> In-Reply-To: <20231023130511.4521-1-aladyshev22@gmail.com> References: <20231023130511.4521-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=JMHLjfZW; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.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 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 (#109910): https://edk2.groups.io/g/devel/message/109910 Mute This Topic: https://groups.io/mt/102134648/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-