From: Marc-Andr? Lureau Date: Tue, 6 Mar 2018 20:27:18 +0000 (+0800) Subject: SecurityPkg: only clear HashInterface information X-Git-Tag: edk2-stable201903~2234 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=4cc2b63bd829426b05bad0d8952f1855a10d6ed7 SecurityPkg: only clear HashInterface information 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 Cc: Chao Zhang Cc: Star Zeng Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marc-Andr? Lureau Reviewed-by: Jiewen Yao Reviewed-by: Chao Zhang Reviewed-by: Star Zeng --- diff --git a/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c b/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c index dbee0f2531..361a4f6508 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; } //