]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/PiSmmCore: Fix an assert issue in pool free
authorJian J Wang <jian.j.wang@intel.com>
Mon, 20 Nov 2017 01:00:27 +0000 (09:00 +0800)
committerHao Wu <hao.a.wu@intel.com>
Mon, 20 Nov 2017 05:06:32 +0000 (13:06 +0800)
Following check-in caused this issue:
  2930ef9809976ce693d1d377851344c3b06bd926

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>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Wu Hao <hao.a.wu@intel.com>
Tested-by: Wu Hao <hao.a.wu@intel.com>
MdeModulePkg/Core/PiSmmCore/Pool.c

index e77caa88538b7f399670f4cccb8cc1ee96faee0b..e98ce01b0f4d03a8b611d3516defb5cdc8fa5e22 100644 (file)
@@ -287,7 +287,7 @@ SmmInternalAllocatePool (
 
     PoolHdr = (POOL_HEADER*)(UINTN)Address;\r
     PoolHdr->Signature = POOL_HEAD_SIGNATURE;\r
-    PoolHdr->Size = Size;
+    PoolHdr->Size = EFI_PAGES_TO_SIZE (NoPages);\r
     PoolHdr->Available = FALSE;\r
     PoolHdr->Type = PoolType;\r