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 C5B0CAC14BA for ; Mon, 23 Oct 2023 13:05:34 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=gCqMqNuk4Vq1cYN0Sfo5dsaOY7pxYd1dO4Ft26CT8Gw=; 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=1698066333; v=1; b=TLZ/xCCWdfvWx8P3jPeju6yN+HkWaY6NvXv5dGPm54dBx8A6g+kco71o59YJbK6l//WlYA7b 9dx+4Sx5WlOJGUL2MC+k338dmw5qWX10tBxtPsR01C9RngzV/5vBwUe/D/IT9qp0F/pV0AmugoI +FHITbh8vc/ljRexRkBuon/U= X-Received: by 127.0.0.2 with SMTP id jN9zYY7687511xrvP7B19bwH; Mon, 23 Oct 2023 06:05:33 -0700 X-Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mx.groups.io with SMTP id smtpd.web11.120299.1698066330723625316 for ; Mon, 23 Oct 2023 06:05:31 -0700 X-Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-507a62d4788so5143252e87.0 for ; Mon, 23 Oct 2023 06:05:30 -0700 (PDT) X-Gm-Message-State: Nt0EMzEYJxcN0YbGroq1iyMZx7686176AA= X-Google-Smtp-Source: AGHT+IGZr8tBncdj4usfAL6iF7PkBv59tg+Pcncj4jwX4jOVv1gn5tHP8LSVtPXXvsiSmVSFWnwdjw== X-Received: by 2002:a2e:b953:0:b0:2bd:1fee:aacf with SMTP id 19-20020a2eb953000000b002bd1feeaacfmr5755684ljs.24.1698066328611; Mon, 23 Oct 2023 06:05:28 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:05:28 -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 16/16] ManageabilityPkg: Check PLDM completion code Date: Mon, 23 Oct 2023 16:05:11 +0300 Message-Id: <20231023130511.4521-17-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="TLZ/xCCW"; 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 Every PLDM response contains 1 byte Completion code which is needed to be checked against SUCCESS value which means that the PLDM command was accepted and completed normally. If it is not equal to that value it is necessary to return error status so the caller would know that Response buffer is invalid. Signed-off-by: Konstantin Aladyshev --- .../Universal/PldmProtocol/Common/PldmProtocolCommon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmPr= otocolCommon.c b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/Pl= dmProtocolCommon.c index 04f250e57c..2f2f76603e 100644 --- a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolC= ommon.c +++ b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolC= ommon.c @@ -293,7 +293,8 @@ CommonPldmSubmitCommand ( (ResponseHeader->PldmHeader.RequestBit !=3D PLDM_MESSAGE_HEADER_IS_R= ESPONSE) ||=0D (ResponseHeader->PldmHeader.InstanceId !=3D mPldmRequestInstanceId) = ||=0D (ResponseHeader->PldmHeader.PldmType !=3D PldmType) ||=0D - (ResponseHeader->PldmHeader.PldmTypeCommandCode !=3D PldmCommand))=0D + (ResponseHeader->PldmHeader.PldmTypeCommandCode !=3D PldmCommand) ||= =0D + (ResponseHeader->PldmCompletionCode !=3D PLDM_COMPLETION_CODE_SUCCES= S))=0D {=0D DEBUG ((DEBUG_ERROR, "PLDM integrity check of response data is failed.= \n"));=0D DEBUG ((DEBUG_ERROR, " Datagram =3D %d (Expected value: %d)\n",= ResponseHeader->PldmHeader.DatagramBit, (!PLDM_MESSAGE_HEADER_IS_DATAGRAM)= ));=0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109924): https://edk2.groups.io/g/devel/message/109924 Mute This Topic: https://groups.io/mt/102134666/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-