[edk2] [PATCH] SecurityPkg:Tcg2Smm: Fix compile issue

Zhang, Chao B posted 1 patch 6 years, 10 months ago
Failed in applying to current master (apply log)
SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
[edk2] [PATCH] SecurityPkg:Tcg2Smm: Fix compile issue
Posted by Zhang, Chao B 6 years, 10 months ago
Update Tcg2Smm _PRS patching logic to fix compile issue

Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
---
 SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
index e3938cb..6eb62ae 100644
--- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
+++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
@@ -539,10 +539,11 @@ UpdatePossibleResource (
   *(DataPtr + 1) = 0;
 
   //
-  // 5. Jump over whole ResourceTemplate. Stuff rest bytes to NOOP
+  // 5. Jump over new ResourceTemplate. Stuff rest bytes to NOOP
   //
-  for (DataPtr += 2; DataPtr < DataEndPtr; DataPtr++) {
-    *DataPtr = AML_NOOP_OP;
+  DataPtr += 2;
+  if (DataPtr < DataEndPtr) {
+    SetMem(DataPtr, (UINTN)(DataEndPtr - DataPtr), AML_NOOP_OP);
   }
 
   return EFI_SUCCESS;
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] SecurityPkg:Tcg2Smm: Fix compile issue
Posted by Gao, Liming 6 years, 10 months ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Zhang, Chao B
>Sent: Tuesday, February 06, 2018 10:28 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>; Bi, Dandan <dandan.bi@intel.com>;
>Zhang, Chao B <chao.b.zhang@intel.com>
>Subject: [PATCH] SecurityPkg:Tcg2Smm: Fix compile issue
>
>Update Tcg2Smm _PRS patching logic to fix compile issue
>
>Cc: Liming Gao <liming.gao@intel.com>
>Cc: Dandan Bi <dandan.bi@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
>---
> SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
>diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
>b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
>index e3938cb..6eb62ae 100644
>--- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
>+++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
>@@ -539,10 +539,11 @@ UpdatePossibleResource (
>   *(DataPtr + 1) = 0;
>
>   //
>-  // 5. Jump over whole ResourceTemplate. Stuff rest bytes to NOOP
>+  // 5. Jump over new ResourceTemplate. Stuff rest bytes to NOOP
>   //
>-  for (DataPtr += 2; DataPtr < DataEndPtr; DataPtr++) {
>-    *DataPtr = AML_NOOP_OP;
>+  DataPtr += 2;
>+  if (DataPtr < DataEndPtr) {
>+    SetMem(DataPtr, (UINTN)(DataEndPtr - DataPtr), AML_NOOP_OP);
>   }
>
>   return EFI_SUCCESS;
>--
>1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel