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 3CEB9D802AD for ; Tue, 12 Mar 2024 15:40:12 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=OYyEjCUguHjKEPxIAg9hV9jHgZKM+trrggKu+6Pqw8g=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1710258010; v=1; b=2L5kIebfOolGfN2Xte1jryhf1QSZIAtvngZiW+qVzI7AqONSCTtTWBq+Kd6NH+QCMXutyM22 ubtXaj2vhNbeUxrLFa6/W+CI/yaqtZcdQRXrgNPQrGXkS8dkChYn7xab1QAxTSEV6ERjKbHXWV5 B7ZzCHko4URnuOz1lD9q0tvNWXJ7GrOCzHOiFt3VJV7bP9faUzoEWiKksKBiDlnhg3LQhUwGEOq gGQ2ijAjLElT8bGj34qYpnyxbWLIt5f9zkIXN9ele03CuH8tVuVsKwfMKH+06WktSCwUvyw2YSu 5/txsWja3irHZcKAyFw/sgtEfci/Rwt6SMJQ7DCQKoKyA== X-Received: by 127.0.0.2 with SMTP id DGK3YY7687511xaiTHm2Dyzp; Tue, 12 Mar 2024 08:40:10 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mx.groups.io with SMTP id smtpd.web10.4424.1710235266111318199 for ; Tue, 12 Mar 2024 02:21:06 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,11010"; a="16373594" X-IronPort-AV: E=Sophos;i="6.07,119,1708416000"; d="scan'208";a="16373594" X-Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2024 02:21:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,119,1708416000"; d="scan'208";a="16113200" X-Received: from sh1gapp1006.ccr.corp.intel.com ([10.239.189.76]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2024 02:21:03 -0700 From: "Du Lin" To: devel@edk2.groups.io Cc: Du Lin , Ashraf Ali S , Chasel Chiu , Chen Gang C , Duggapu Chinni B , Nate DeSimone , Star Zeng , Susovan Mohapatra , Ted Kuo Subject: [edk2-devel] [PATCH] IntelFsp2WrapperPkg: Error handling of TpmMeasureAndLogDataWithFlags() Date: Tue, 12 Mar 2024 17:20:28 +0800 Message-ID: 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 Resent-Date: Tue, 12 Mar 2024 08:40:05 -0700 Reply-To: devel@edk2.groups.io,du.lin@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: y4kHm4lM5BLpOMSF08aKFI2cx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=2L5kIebf; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4700 TpmMeasureAndLogDataWithFlags() computes the measure the code and log it into PCR 0. TpmMeasureAndLogData() computes the hash for the configuration. The same "Status" variable is used to store the return values for both of the functions. There is no error handling if TpmMeasureAndLogDataWithFlags() returns an error Status. Fix the issue by adding error handling for TpmMeasureAndLogDataWithFlags(). Signed-off-by: Du Lin Cc: Ashraf Ali S Cc: Chasel Chiu Cc: Chen Gang C Cc: Duggapu Chinni B Cc: Nate DeSimone Cc: Star Zeng Cc: Susovan Mohapatra Cc: Ted Kuo --- .../Library/BaseFspMeasurementLib/FspMeasurementLib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c index 2c017a4250..228277649b 100644 --- a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c +++ b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c @@ -197,6 +197,10 @@ MeasureFspFirmwareBlobWithCfg ( (UINTN)sizeof (DigestList), EDKII_TCG_PRE_HASH_LOG_ONLY ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "TpmMeasureAndLogDataWithFlags failed - %r\n", Status)); + return Status; + } Status = TpmMeasureAndLogData ( 1, -- 2.26.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116685): https://edk2.groups.io/g/devel/message/116685 Mute This Topic: https://groups.io/mt/104886875/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-