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=star.zeng@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 E12C52035BB03 for ; Sun, 19 Nov 2017 18:49:40 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Nov 2017 18:53:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,424,1505804400"; d="scan'208";a="7114787" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 19 Nov 2017 18:53:53 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 19 Nov 2017 18:53:53 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.175]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Mon, 20 Nov 2017 10:53:51 +0800 From: "Zeng, Star" To: "Wang, Jian J" , "edk2-devel@lists.01.org" CC: "Dong, Eric" , "Wu, Hao A" , "Zeng, Star" Thread-Topic: [PATCH] MdeModulePkg/PiSmmCore: Fix an assert issue in pool free Thread-Index: AQHTYak8B6zDJo+Gk06k0fB5YTYeEqMckfdA Date: Mon, 20 Nov 2017 02:53:51 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B9B81E2@shsmsx102.ccr.corp.intel.com> References: <20171120024226.16280-1-jian.j.wang@intel.com> In-Reply-To: <20171120024226.16280-1-jian.j.wang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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:49:41 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng By the way, could you add comments in the commit log to say which commit is= causing this issue? Thanks, Star -----Original Message----- From: Wang, Jian J=20 Sent: Monday, November 20, 2017 10:42 AM To: edk2-devel@lists.01.org Cc: Zeng, Star ; Dong, Eric ; Wu,= Hao A Subject: [PATCH] MdeModulePkg/PiSmmCore: Fix an assert issue in pool free This issue is caused by assigning incorrect value to PoolHdr.Size if the re= quested 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/PiSmmCo= re/Pool.c index e77caa8853..e98ce01b0f 100644 --- a/MdeModulePkg/Core/PiSmmCore/Pool.c +++ b/MdeModulePkg/Core/PiSmmCore/Pool.c @@ -287,7 +287,7 @@ SmmInternalAllocatePool ( =20 PoolHdr =3D (POOL_HEADER*)(UINTN)Address; PoolHdr->Signature =3D POOL_HEAD_SIGNATURE; - PoolHdr->Size =3D Size; + PoolHdr->Size =3D EFI_PAGES_TO_SIZE (NoPages); PoolHdr->Available =3D FALSE; PoolHdr->Type =3D PoolType; =20 -- 2.14.1.windows.1