public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/PiSmmCore: Fix an assert issue in pool free
@ 2017-11-20  2:42 Jian J Wang
  2017-11-20  2:53 ` Zeng, Star
  0 siblings, 1 reply; 4+ messages in thread
From: Jian J Wang @ 2017-11-20  2:42 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Eric Dong, Wu Hao

This issue is caused by assigning incorrect value to PoolHdr.Size
if the requested size is more than MAX_POOL_SIZE, because the SMM
core will actually allocate page memory instead of pool memory in
this situation.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Wu Hao <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
---
 MdeModulePkg/Core/PiSmmCore/Pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c b/MdeModulePkg/Core/PiSmmCore/Pool.c
index e77caa8853..e98ce01b0f 100644
--- a/MdeModulePkg/Core/PiSmmCore/Pool.c
+++ b/MdeModulePkg/Core/PiSmmCore/Pool.c
@@ -287,7 +287,7 @@ SmmInternalAllocatePool (
 
     PoolHdr = (POOL_HEADER*)(UINTN)Address;
     PoolHdr->Signature = POOL_HEAD_SIGNATURE;
-    PoolHdr->Size = Size;
+    PoolHdr->Size = EFI_PAGES_TO_SIZE (NoPages);
     PoolHdr->Available = FALSE;
     PoolHdr->Type = PoolType;
 
-- 
2.14.1.windows.1



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

end of thread, other threads:[~2017-11-20  3:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-20  2:42 [PATCH] MdeModulePkg/PiSmmCore: Fix an assert issue in pool free Jian J Wang
2017-11-20  2:53 ` Zeng, Star
2017-11-20  3:07   ` Wu, Hao A
2017-11-20  3:21   ` Wang, Jian J

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