From nobody Fri Dec 19 20:54:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109852+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109852+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1697806392; cv=none; d=zohomail.com; s=zohoarc; b=KPLAj4+edl0x4w28EajMeTdCipVGxfjcrCyz7Bog+jEUATNv9ZSm2/a3zUE5A+jJWkgWbJMacEF6q3QiFB9m+U8t8WbA2hRWToqwcz9Hr7eUnhFQ8YSmYozOSr9SKmZgDiV13l+LK+9Yv4ABXLnohyKCGaZuy4NpZLt8OZL3uiM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697806392; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=kE1cDHICZv033rWKkG3+cIDd2KNTGJOnHDJSmQP60O0=; b=mcaeOqaBEwaKkNVPJYxLa/MPXKQD9sKfrbnKD4QQKCU/IeJfyqemSXqDpWJnqRXZt9g/ivWmXU7tnP7DgPXHsdM5HZfQBgQO+6bLgd+SpaB9ivIPHS6+4Bsx6wf8XcWJ4qs+PmjyenjqP4dWX6nYba1VOQRt00YkfHZAIapu/AI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109852+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1697806392044421.97945952696205; Fri, 20 Oct 2023 05:53:12 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=kXxk3oLypSzQ8FF33I34SrKNVuelss538MwGgp/YTxs=; 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=1697806391; v=1; b=SFq1tQSwtieHe881zG1fri03PyyM2NjjTEvDRS+jdBVIXmwDqWJFm1q12WGPH6TsWZzx8YQa wDW4X1Wm7Eqvqkkt8IaHZbV8WayCNN/gbQRpCbVYkp9YMaGnqCy0iL+bxwX9O86a35HqOZDAFZL /mlGSN8W9i+0vTW0j8964Z9w= X-Received: by 127.0.0.2 with SMTP id xAAOYY1788612xKJkUVyf6kh; Fri, 20 Oct 2023 05:53:11 -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: fyEm7AaprqbSzDnKjg5U9Pk1x1787277AA= 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-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697806392512100001 Content-Type: text/plain; charset="utf-8" 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; } =20 + // + // Check source EID and destination EID + // + if ((MctpSourceEndpointId >=3D MCTP_RESERVED_ENDPOINT_START_ID) && + (MctpSourceEndpointId <=3D MCTP_RESERVED_ENDPOINT_END_ID) + ) { + DEBUG ((DEBUG_ERROR, "%a: The value of MCTP source EID (%x) is reserve= d.\n", __func__, MctpSourceEndpointId)); + return EFI_INVALID_PARAMETER; + } + + if ((MctpDestinationEndpointId >=3D MCTP_RESERVED_ENDPOINT_START_ID) && + (MctpDestinationEndpointId <=3D MCTP_RESERVED_ENDPOINT_END_ID) + ) { + DEBUG ((DEBUG_ERROR, "%a: The value of MCTP destination EID (%x) is re= served.\n", __func__, MctpDestinationEndpointId)); + return EFI_INVALID_PARAMETER; + } + Status =3D CommonMctpSubmitMessage ( mTransportToken, MctpType, --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-