From 94edadf502bd0e61f00bb08a5df2e078af54a770 Mon Sep 17 00:00:00 2001 From: Jian J Wang Date: Mon, 20 Nov 2017 09:00:27 +0800 Subject: [PATCH] MdeModulePkg/PiSmmCore: Fix an assert issue in pool free 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 Cc: Eric Dong Cc: Wu Hao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang Reviewed-by: Star Zeng Reviewed-by: Wu Hao Tested-by: Wu Hao --- 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;