[edk2-devel] [PATCH 3/6] MdeModulePkg/Smbios: Done measure Smbios multiple times.

Yao, Jiewen posted 6 patches 6 years, 1 month ago
[edk2-devel] [PATCH 3/6] MdeModulePkg/Smbios: Done measure Smbios multiple times.
Posted by Yao, Jiewen 6 years, 1 month ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2439

In current implementation, the SMBIOS table is measured multiple
time in every readytoboot event.

This causes Smbios Table record appears multiple time in the TCG event log
and confuses people.

This issue makes it hard to implement 800-155 reference measurement.

This patch closes the event to make sure Smbios is measured only once.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
---
 .../Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
index 7b5d473146..5ec2aca095 100644
--- a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
+++ b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
@@ -577,8 +577,8 @@ MeasureSmbiosTable (
                TableAddress,            // HashData
                TableLength              // HashDataLen
                );
-    if (EFI_ERROR (Status)) {
-      return ;
+    if (!EFI_ERROR (Status)) {
+      gBS->CloseEvent (Event) ;
     }
   }
 
-- 
2.19.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#52626): https://edk2.groups.io/g/devel/message/52626
Mute This Topic: https://groups.io/mt/69344970/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 3/6] MdeModulePkg/Smbios: Done measure Smbios multiple times.
Posted by Zeng, Star 6 years, 1 month ago
Reviewed-by: Star Zeng <star.zeng@intel.com>

> -----Original Message-----
> From: Yao, Jiewen
> Sent: Tuesday, December 31, 2019 2:44 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> Bi, Dandan <dandan.bi@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [PATCH 3/6] MdeModulePkg/Smbios: Done measure Smbios
> multiple times.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2439
> 
> In current implementation, the SMBIOS table is measured multiple time in
> every readytoboot event.
> 
> This causes Smbios Table record appears multiple time in the TCG event log
> and confuses people.
> 
> This issue makes it hard to implement 800-155 reference measurement.
> 
> This patch closes the event to make sure Smbios is measured only once.
> 
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
> ---
>  .../Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c     | 4 ++-
> -
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasuremen
> tDxe.c
> b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasureme
> ntDxe.c
> index 7b5d473146..5ec2aca095 100644
> ---
> a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasuremen
> tDxe.c
> +++
> b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasureme
> ntDxe.c
> @@ -577,8 +577,8 @@ MeasureSmbiosTable (
>                 TableAddress,            // HashData
>                 TableLength              // HashDataLen
>                 );
> -    if (EFI_ERROR (Status)) {
> -      return ;
> +    if (!EFI_ERROR (Status)) {
> +      gBS->CloseEvent (Event) ;
>      }
>    }
> 
> --
> 2.19.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#52647): https://edk2.groups.io/g/devel/message/52647
Mute This Topic: https://groups.io/mt/69344970/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-