public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH] IntelFsp2WrapperPkg: Error handling of TpmMeasureAndLogDataWithFlags()
@ 2024-03-12  9:20 Du Lin
  2024-03-13  1:45 ` Chen, Gang C
  2024-03-13  6:47 ` Ashraf Ali S
  0 siblings, 2 replies; 3+ messages in thread
From: Du Lin @ 2024-03-12  9:20 UTC (permalink / raw)
  To: devel
  Cc: Du Lin, Ashraf Ali S, Chasel Chiu, Chen Gang C, Duggapu Chinni B,
	Nate DeSimone, Star Zeng, Susovan Mohapatra, Ted Kuo

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 <du.lin@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Chen Gang C <gang.c.chen@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Susovan Mohapatra <susovan.mohapatra@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
---
 .../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]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH] IntelFsp2WrapperPkg: Error handling of TpmMeasureAndLogDataWithFlags()
  2024-03-12  9:20 [edk2-devel] [PATCH] IntelFsp2WrapperPkg: Error handling of TpmMeasureAndLogDataWithFlags() Du Lin
@ 2024-03-13  1:45 ` Chen, Gang C
  2024-03-13  6:47 ` Ashraf Ali S
  1 sibling, 0 replies; 3+ messages in thread
From: Chen, Gang C @ 2024-03-13  1:45 UTC (permalink / raw)
  To: Lin, Du, devel@edk2.groups.io
  Cc: S, Ashraf Ali, Chiu, Chasel, Duggapu, Chinni B,
	Desimone, Nathaniel L, Zeng, Star, Mohapatra, Susovan, Kuo, Ted

Reviewed-by: Chen Gang C <gang.c.chen@intel.com>

BR
Gang

-----Original Message-----
From: Lin, Du <du.lin@intel.com> 
Sent: Tuesday, March 12, 2024 5:20 PM
To: devel@edk2.groups.io
Cc: Lin, Du <du.lin@intel.com>; S, Ashraf Ali <ashraf.ali.s@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Chen, Gang C <gang.c.chen@intel.com>; Duggapu, Chinni B <chinni.b.duggapu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>; Mohapatra, Susovan <susovan.mohapatra@intel.com>; Kuo, Ted <ted.kuo@intel.com>
Subject: [PATCH] IntelFsp2WrapperPkg: Error handling of TpmMeasureAndLogDataWithFlags()

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 <du.lin@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Chen Gang C <gang.c.chen@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Susovan Mohapatra <susovan.mohapatra@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
---
 .../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/FspMeasurementLi
+++ b.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 (#116700): https://edk2.groups.io/g/devel/message/116700
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]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH] IntelFsp2WrapperPkg: Error handling of TpmMeasureAndLogDataWithFlags()
  2024-03-12  9:20 [edk2-devel] [PATCH] IntelFsp2WrapperPkg: Error handling of TpmMeasureAndLogDataWithFlags() Du Lin
  2024-03-13  1:45 ` Chen, Gang C
@ 2024-03-13  6:47 ` Ashraf Ali S
  1 sibling, 0 replies; 3+ messages in thread
From: Ashraf Ali S @ 2024-03-13  6:47 UTC (permalink / raw)
  To: Lin, Du, devel@edk2.groups.io
  Cc: Chiu, Chasel, Chen, Gang C, Duggapu, Chinni B,
	Desimone, Nathaniel L, Zeng, Star, Mohapatra, Susovan, Kuo, Ted

Reviewed-by: S, Ashraf Ali <ashraf.ali.s@intel.com>

Thanks.,
S, Ashraf Ali

-----Original Message-----
From: Lin, Du <du.lin@intel.com> 
Sent: Tuesday, March 12, 2024 2:50 PM
To: devel@edk2.groups.io
Cc: Lin, Du <du.lin@intel.com>; S, Ashraf Ali <ashraf.ali.s@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Chen, Gang C <gang.c.chen@intel.com>; Duggapu, Chinni B <chinni.b.duggapu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>; Mohapatra, Susovan <susovan.mohapatra@intel.com>; Kuo, Ted <ted.kuo@intel.com>
Subject: [PATCH] IntelFsp2WrapperPkg: Error handling of TpmMeasureAndLogDataWithFlags()

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 <du.lin@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Chen Gang C <gang.c.chen@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Susovan Mohapatra <susovan.mohapatra@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
---
 .../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/FspMeasurementLi
+++ b.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 (#116706): https://edk2.groups.io/g/devel/message/116706
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]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-13  6:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-12  9:20 [edk2-devel] [PATCH] IntelFsp2WrapperPkg: Error handling of TpmMeasureAndLogDataWithFlags() Du Lin
2024-03-13  1:45 ` Chen, Gang C
2024-03-13  6:47 ` Ashraf Ali S

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox