From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8869921C913BC for ; Sun, 19 Nov 2017 18:38:19 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Nov 2017 18:42:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,424,1505804400"; d="scan'208";a="178241821" Received: from jwang36-mobl2.ccr.corp.intel.com ([10.239.192.35]) by fmsmga006.fm.intel.com with ESMTP; 19 Nov 2017 18:42:28 -0800 From: Jian J Wang To: edk2-devel@lists.01.org Cc: Star Zeng , Eric Dong , Wu Hao Date: Mon, 20 Nov 2017 10:42:26 +0800 Message-Id: <20171120024226.16280-1-jian.j.wang@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 Subject: [PATCH] MdeModulePkg/PiSmmCore: Fix an assert issue in pool free X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 02:38:19 -0000 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 --- 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