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 0E8B9740038 for ; Mon, 23 Oct 2023 13:05:32 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4ApQ4K19D6PxzMUck+7MM4Ba/4SdKG1RWv2K6zQFfcM=; 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=1698066331; v=1; b=rIF62Mk0Wvsoo3Msdri0t5TmoPxipHl6i8eoCbjXJaadja3/dB3EYfpxQHJh8VY875hPRF0i ySjPo9iFbyOg7Pa2NhW92PP92N2yQHtbW2fSKrD1k6XZGS1gZbLuhzwgJ9YbiU9QnNV4xPyXpXa Vp+yivnBX4hhFsKuwbkRIqe0= X-Received: by 127.0.0.2 with SMTP id 5wtjYY7687511xw7C7AVm3Dw; Mon, 23 Oct 2023 06:05:31 -0700 X-Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by mx.groups.io with SMTP id smtpd.web11.120298.1698066329258157547 for ; Mon, 23 Oct 2023 06:05:29 -0700 X-Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2c50305c5c4so49585041fa.1 for ; Mon, 23 Oct 2023 06:05:28 -0700 (PDT) X-Gm-Message-State: iaIyXVLBzpJsb04t4qigNAXex7686176AA= X-Google-Smtp-Source: AGHT+IFxVYRLMNP+I8+KylD7smD/6CjisGUBYH3WF+nx31e0Invd7UJ3qVOdxAlw2W8zR85rnOPB+w== X-Received: by 2002:a05:651c:1a29:b0:2bc:f5a0:cc25 with SMTP id by41-20020a05651c1a2900b002bcf5a0cc25mr7084478ljb.2.1698066326918; Mon, 23 Oct 2023 06:05:26 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:05:26 -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 14/16] ManageabilityPkg: Return error on PLDM header check fails Date: Mon, 23 Oct 2023 16:05:09 +0300 Message-Id: <20231023130511.4521-15-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=rIF62Mk0; 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 Currently PldmSubmit command returns EFI_SUCCESS even if the response header checks have failed. Correct the code to return errors in such cases. Signed-off-by: Konstantin Aladyshev --- .../Universal/PldmProtocol/Common/PldmProtocolCommon.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmPr= otocolCommon.c b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/Pl= dmProtocolCommon.c index bc72ce07b3..04f250e57c 100644 --- a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolC= ommon.c +++ b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolC= ommon.c @@ -241,7 +241,7 @@ CommonPldmSubmitCommand ( if (FullPacketResponseData =3D=3D NULL) {=0D DEBUG ((DEBUG_ERROR, " Not enough memory for FullPacketResponseDataSi= ze.\n"));=0D Status =3D EFI_OUT_OF_RESOURCES;=0D - goto ErrorExit2;=0D + goto ErrorExit;=0D }=0D =0D // Print out PLDM packet.=0D @@ -281,6 +281,7 @@ CommonPldmSubmitCommand ( FullPacketResponseDataSize=0D ));=0D HelperManageabilityDebugPrint ((VOID *)FullPacketResponseData, Transfe= rToken.ReceivePackage.ReceiveSizeInByte, "Failed response payload\n");=0D + Status =3D EFI_DEVICE_ERROR;=0D goto ErrorExit;=0D }=0D =0D @@ -303,6 +304,7 @@ CommonPldmSubmitCommand ( DEBUG ((DEBUG_ERROR, " Pldm Completion Code =3D 0x%x\n", ResponseHe= ader->PldmCompletionCode));=0D =0D HelperManageabilityDebugPrint ((VOID *)FullPacketResponseData, Transfe= rToken.ReceivePackage.ReceiveSizeInByte, "Failed response payload\n");=0D + Status =3D EFI_DEVICE_ERROR;=0D goto ErrorExit;=0D }=0D =0D @@ -319,6 +321,7 @@ CommonPldmSubmitCommand ( ));=0D =0D HelperManageabilityDebugPrint ((VOID *)FullPacketResponseData, Transfe= rToken.ReceivePackage.ReceiveSizeInByte, "Failed response payload\n");=0D + Status =3D EFI_DEVICE_ERROR;=0D goto ErrorExit;=0D }=0D =0D @@ -332,6 +335,7 @@ CommonPldmSubmitCommand ( ResponseHeader->PldmCompletionCode=0D ));=0D HelperManageabilityDebugPrint ((VOID *)FullPacketResponseData, GET_PLD= M_MESSAGE_PAYLOAD_SIZE(TransferToken.ReceivePackage.ReceiveSizeInByte), "Fa= iled response payload\n");=0D + Status =3D EFI_DEVICE_ERROR;=0D goto ErrorExit;=0D }=0D =0D @@ -350,13 +354,12 @@ CommonPldmSubmitCommand ( =0D // Return transfer status.=0D //=0D -ErrorExit:=0D Status =3D TransferToken.TransferStatus;=0D if (EFI_ERROR (Status)) {=0D DEBUG ((DEBUG_ERROR, "%a: Failed to send PLDM command over %s\n", __fu= nc__, mTransportName));=0D }=0D =0D -ErrorExit2:=0D +ErrorExit:=0D if (PldmTransportHeader !=3D NULL) {=0D FreePool ((VOID *)PldmTransportHeader);=0D }=0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109922): https://edk2.groups.io/g/devel/message/109922 Mute This Topic: https://groups.io/mt/102134664/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-