public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] RFC: SecurityPkg: only clear HashInterface informations
@ 2018-03-06 20:27 marcandre.lureau
  2018-03-07  0:40 ` Zeng, Star
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: marcandre.lureau @ 2018-03-06 20:27 UTC (permalink / raw)
  To: edk2-devel
  Cc: Marc-André Lureau, Jiewen Yao, Chao Zhang, Star Zeng,
	Laszlo Ersek

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The ZeroMem() call goes beyond the HashInterfaceHob structure, causing
HOB list corruption. Instead, just clear the HashInterface fields, as
I suppose was originally intended.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 .../HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c b/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c
index dbee0f2531bc..361a4f6508a0 100644
--- a/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c
+++ b/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c
@@ -424,7 +424,8 @@ HashLibBaseCryptoRouterPeiConstructor (
     // This is the second execution of this module, clear the hash interface
     // information registered at its first execution.
     //
-    ZeroMem (&HashInterfaceHob->HashInterface, sizeof (*HashInterfaceHob) - sizeof (EFI_GUID));
+    ZeroMem (&HashInterfaceHob->HashInterface, sizeof (HashInterfaceHob->HashInterface));
+    HashInterfaceHob->HashInterfaceCount = 0;
   }
 
   //
-- 
2.16.2.346.g9779355e34



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

end of thread, other threads:[~2018-03-07 20:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-06 20:27 [PATCH 1/1] RFC: SecurityPkg: only clear HashInterface informations marcandre.lureau
2018-03-07  0:40 ` Zeng, Star
2018-03-07  0:40 ` Yao, Jiewen
2018-03-07  2:03 ` Zhang, Chao B
2018-03-07  9:06 ` Laszlo Ersek
2018-03-07  9:42   ` Zeng, Star
2018-03-07 15:05     ` Zeng, Star
2018-03-07 20:50     ` Laszlo Ersek
2018-03-07 10:53   ` Marc-André Lureau

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