[edk2-devel] [PATCH] SecurityPkg: Initailize variable Status before it is consumed.

Zhiguang Liu posted 1 patch 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/edk2 tags/patchew/20200901005505.1722-1-zhiguang.liu@intel.com
SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 1 +
1 file changed, 1 insertion(+)

[edk2-devel] [PATCH] SecurityPkg: Initailize variable Status before it is consumed.

Posted by Zhiguang Liu 2 weeks ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2945

V2: Move "Status = EFI_SUCCESS;" before the EDKII_TCG_PRE_HASH check.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Qi Zhang <qi1.zhang@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
 SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
index 0e770f4485..93a8803ff6 100644
--- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
+++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
@@ -456,6 +456,7 @@ HashLogExtendEvent (
   if ((Flags & EDKII_TCG_PRE_HASH) != 0 || (Flags & EDKII_TCG_PRE_HASH_LOG_ONLY) != 0) {
     ZeroMem (&DigestList, sizeof(DigestList));
     CopyMem (&DigestList, HashData, sizeof(DigestList));
+    Status = EFI_SUCCESS;
     if ((Flags & EDKII_TCG_PRE_HASH) !=0 ) {
       Status = Tpm2PcrExtend (
                NewEventHdr->PCRIndex,
-- 
2.25.1.windows.1


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

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

Re: [edk2-devel] [PATCH] SecurityPkg: Initailize variable Status before it is consumed.

Posted by Laszlo Ersek 2 weeks ago
On 09/01/20 02:55, Zhiguang Liu wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2945
> 
> V2: Move "Status = EFI_SUCCESS;" before the EDKII_TCG_PRE_HASH check.
> 
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Qi Zhang <qi1.zhang@intel.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
> ---
>  SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
> index 0e770f4485..93a8803ff6 100644
> --- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
> +++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
> @@ -456,6 +456,7 @@ HashLogExtendEvent (
>    if ((Flags & EDKII_TCG_PRE_HASH) != 0 || (Flags & EDKII_TCG_PRE_HASH_LOG_ONLY) != 0) {
>      ZeroMem (&DigestList, sizeof(DigestList));
>      CopyMem (&DigestList, HashData, sizeof(DigestList));
> +    Status = EFI_SUCCESS;
>      if ((Flags & EDKII_TCG_PRE_HASH) !=0 ) {
>        Status = Tpm2PcrExtend (
>                 NewEventHdr->PCRIndex,
> 

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

I'll let Jiewen or Jian merge this.

Please change the status of TianoCore#2945 to IN_PROGRESS, and link both
versions of this patch into the ticket as well (in a new comment).

Thanks
Laszlo


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

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

Re: [edk2-devel] [PATCH] SecurityPkg: Initailize variable Status before it is consumed.

Posted by Laszlo Ersek 2 weeks ago
On 09/01/20 09:02, Laszlo Ersek wrote:
> On 09/01/20 02:55, Zhiguang Liu wrote:
>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2945
>>
>> V2: Move "Status = EFI_SUCCESS;" before the EDKII_TCG_PRE_HASH check.
>>
>> Cc: Jiewen Yao <jiewen.yao@intel.com>
>> Cc: Jian J Wang <jian.j.wang@intel.com>
>> Cc: Qi Zhang <qi1.zhang@intel.com>
>> Cc: Rahul Kumar <rahul1.kumar@intel.com>
>> Cc: Laszlo Ersek <lersek@redhat.com>
>> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
>> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
>> ---
>>  SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
>> index 0e770f4485..93a8803ff6 100644
>> --- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
>> +++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
>> @@ -456,6 +456,7 @@ HashLogExtendEvent (
>>    if ((Flags & EDKII_TCG_PRE_HASH) != 0 || (Flags & EDKII_TCG_PRE_HASH_LOG_ONLY) != 0) {
>>      ZeroMem (&DigestList, sizeof(DigestList));
>>      CopyMem (&DigestList, HashData, sizeof(DigestList));
>> +    Status = EFI_SUCCESS;
>>      if ((Flags & EDKII_TCG_PRE_HASH) !=0 ) {
>>        Status = Tpm2PcrExtend (
>>                 NewEventHdr->PCRIndex,
>>
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> 
> I'll let Jiewen or Jian merge this.
> 
> Please change the status of TianoCore#2945 to IN_PROGRESS, and link both
> versions of this patch into the ticket as well (in a new comment).

Merged as commit 46db105b7b77, via
<https://github.com/tianocore/edk2/pull/909>.

BZ updated.

Thanks
Laszlo


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

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