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 B3132AC1204 for ; Fri, 20 Oct 2023 12:53:13 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=VdvzFKK+IKZJBLey5TalEfZ3oAQyHKmuLGbzM/tnDWI=; 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=1697806392; v=1; b=hTacRbbn9SgsbRIQPX2Mr7v5dn+Agm9q2F1iMSuq2krzhVA/xki9VqStUqUu0fk/xUtTlYYl 6/ML24BDOHV8vHZ4Usg+jwk9khSweWxDO4eaiKFj0G/CL4Py8X136vWlpzPXUy8tjEMGnWdcUCt j0iuu8fmaHl4pKnLZrkZYohI= X-Received: by 127.0.0.2 with SMTP id oW3WYY7687511x2yj7vdVe2A; Fri, 20 Oct 2023 05:53:12 -0700 X-Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by mx.groups.io with SMTP id smtpd.web10.53374.1697806390965076050 for ; Fri, 20 Oct 2023 05:53:11 -0700 X-Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2c17de836fbso10948671fa.1 for ; Fri, 20 Oct 2023 05:53:10 -0700 (PDT) X-Gm-Message-State: Ld2yXeXyVEx5ibhK2uYIixVOx7686176AA= X-Google-Smtp-Source: AGHT+IEt+wgnbEL1km2gwNfDxlmpYEKMKazbtXN18sWjZEKxtwzr7J5K4W0Z6IUVT/KrsHLX0V1o6Q== X-Received: by 2002:a2e:8416:0:b0:2c5:1867:b0bc with SMTP id z22-20020a2e8416000000b002c51867b0bcmr1406135ljg.51.1697806388671; Fri, 20 Oct 2023 05:53:08 -0700 (PDT) X-Received: from PC10319.67 ([82.97.198.254]) by smtp.googlemail.com with ESMTPSA id x22-20020a05651c105600b002b9e5fe86dasm350853ljm.81.2023.10.20.05.53.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 05:53:08 -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 v2 02/15] ManageabilityPkg: Check MCTP EIDs for reserved values Date: Fri, 20 Oct 2023 15:52:49 +0300 Message-Id: <20231020125302.1459-3-aladyshev22@gmail.com> In-Reply-To: <20231020125302.1459-1-aladyshev22@gmail.com> References: <20231020125302.1459-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=hTacRbbn; 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 (#109852): https://edk2.groups.io/g/devel/message/109852 Mute This Topic: https://groups.io/mt/102080229/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-