Re: [edk2] [PATCH] SecurityPkg/Tcg2Dxe: Fix undersized TempBuf

2016-03-29 Thread Zhang, Chao B
Reviewed-by: Chao Zhang 





Thanks & Best regards
Chao Zhang

-Original Message-
From: Thomas Palmer [mailto:thomas.pal...@hpe.com] 
Sent: Wednesday, March 30, 2016 6:01 AM
To: edk2-devel@lists.01.org
Cc: Zhang, Chao B; samer.el-haj-mahm...@hpe.com; Thomas Palmer
Subject: [PATCH] SecurityPkg/Tcg2Dxe: Fix undersized TempBuf

TempBuf in SetupEventLog needs to include sizeof (UINT32) to hold 
NumberOfAlgorithms.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer 
---
 SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c 
b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
index b1c885e..ee7c12b 100644
--- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
+++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
@@ -2,6 +2,7 @@
   This module implements Tcg2 Protocol.
   
 Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -1482,7 +1483,7 
@@ SetupEventLog (
   UINT32  DigestListBinSize;
   UINT32  EventSize;
   TCG_EfiSpecIDEventStruct*TcgEfiSpecIdEventStruct;
-  UINT8   TempBuf[sizeof(TCG_EfiSpecIDEventStruct) + 
(HASH_COUNT * sizeof(TCG_EfiSpecIdEventAlgorithmSize)) + sizeof(UINT8)];
+  UINT8   TempBuf[sizeof (TCG_EfiSpecIDEventStruct) + 
sizeof (UINT32) + (HASH_COUNT * sizeof (TCG_EfiSpecIdEventAlgorithmSize)) + 
sizeof (UINT8)];
   TCG_PCR_EVENT_HDR   FirstPcrEvent;
   TCG_EfiSpecIdEventAlgorithmSize *DigestSize;
   TCG_EfiSpecIdEventAlgorithmSize *TempDigestSize;
--
1.9.1

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


Re: [edk2] [PATCH] SecurityPkg/Tcg2Dxe: Fix undersized TempBuf

2016-03-29 Thread Yao, Jiewen
Reviewed by: jiewen@intel.com

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> El-Haj-Mahmoud, Samer
> Sent: Wednesday, March 30, 2016 6:04 AM
> To: Palmer, Thomas <thomas.pal...@hpe.com>; edk2-devel@lists.01.org
> Cc: Zhang, Chao B <chao.b.zh...@intel.com>
> Subject: Re: [edk2] [PATCH] SecurityPkg/Tcg2Dxe: Fix undersized TempBuf
> 
> Reviewed- by: Samer El-Haj-Mahmoud <el...@hpe.com>
> 
> -Original Message-
> From: Palmer, Thomas
> Sent: Tuesday, March 29, 2016 5:01 PM
> To: edk2-devel@lists.01.org
> Cc: chao.b.zh...@intel.com; El-Haj-Mahmoud, Samer
> <samer.el-haj-mahm...@hpe.com>; Palmer, Thomas
> <thomas.pal...@hpe.com>
> Subject: [PATCH] SecurityPkg/Tcg2Dxe: Fix undersized TempBuf
> 
> TempBuf in SetupEventLog needs to include sizeof (UINT32) to hold
> NumberOfAlgorithms.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Thomas Palmer <thomas.pal...@hpe.com>
> ---
>  SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> index b1c885e..ee7c12b 100644
> --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> @@ -2,6 +2,7 @@
>This module implements Tcg2 Protocol.
> 
>  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
> +(C) Copyright 2016 Hewlett Packard Enterprise Development LP
>  This program and the accompanying materials  are licensed and made
> available under the terms and conditions of the BSD License  which
> accompanies this distribution.  The full text of the license may be found at
> @@ -1482,7 +1483,7 @@ SetupEventLog (
>UINT32  DigestListBinSize;
>UINT32  EventSize;
>TCG_EfiSpecIDEventStruct*TcgEfiSpecIdEventStruct;
> -  UINT8
> TempBuf[sizeof(TCG_EfiSpecIDEventStruct) + (HASH_COUNT *
> sizeof(TCG_EfiSpecIdEventAlgorithmSize)) + sizeof(UINT8)];
> +  UINT8   TempBuf[sizeof
> (TCG_EfiSpecIDEventStruct) + sizeof (UINT32) + (HASH_COUNT * sizeof
> (TCG_EfiSpecIdEventAlgorithmSize)) + sizeof (UINT8)];
>TCG_PCR_EVENT_HDR   FirstPcrEvent;
>TCG_EfiSpecIdEventAlgorithmSize *DigestSize;
>TCG_EfiSpecIdEventAlgorithmSize *TempDigestSize;
> --
> 1.9.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] SecurityPkg/Tcg2Dxe: Fix undersized TempBuf

2016-03-29 Thread El-Haj-Mahmoud, Samer
Reviewed- by: Samer El-Haj-Mahmoud 

-Original Message-
From: Palmer, Thomas 
Sent: Tuesday, March 29, 2016 5:01 PM
To: edk2-devel@lists.01.org
Cc: chao.b.zh...@intel.com; El-Haj-Mahmoud, Samer 
; Palmer, Thomas 
Subject: [PATCH] SecurityPkg/Tcg2Dxe: Fix undersized TempBuf

TempBuf in SetupEventLog needs to include sizeof (UINT32) to hold 
NumberOfAlgorithms.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer 
---
 SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c 
b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
index b1c885e..ee7c12b 100644
--- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
+++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
@@ -2,6 +2,7 @@
   This module implements Tcg2 Protocol.
   
 Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -1482,7 +1483,7 
@@ SetupEventLog (
   UINT32  DigestListBinSize;
   UINT32  EventSize;
   TCG_EfiSpecIDEventStruct*TcgEfiSpecIdEventStruct;
-  UINT8   TempBuf[sizeof(TCG_EfiSpecIDEventStruct) + 
(HASH_COUNT * sizeof(TCG_EfiSpecIdEventAlgorithmSize)) + sizeof(UINT8)];
+  UINT8   TempBuf[sizeof (TCG_EfiSpecIDEventStruct) + 
sizeof (UINT32) + (HASH_COUNT * sizeof (TCG_EfiSpecIdEventAlgorithmSize)) + 
sizeof (UINT8)];
   TCG_PCR_EVENT_HDR   FirstPcrEvent;
   TCG_EfiSpecIdEventAlgorithmSize *DigestSize;
   TCG_EfiSpecIdEventAlgorithmSize *TempDigestSize;
--
1.9.1

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