public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jian J Wang <jian.j.wang@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>, Eric Dong <eric.dong@intel.com>,
	Wu Hao <hao.a.wu@intel.com>
Subject: [PATCH] MdeModulePkg/PiSmmCore: Fix an assert issue in pool free
Date: Mon, 20 Nov 2017 10:42:26 +0800	[thread overview]
Message-ID: <20171120024226.16280-1-jian.j.wang@intel.com> (raw)

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



             reply	other threads:[~2017-11-20  2:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20  2:42 Jian J Wang [this message]
2017-11-20  2:53 ` [PATCH] MdeModulePkg/PiSmmCore: Fix an assert issue in pool free Zeng, Star
2017-11-20  3:07   ` Wu, Hao A
2017-11-20  3:21   ` Wang, Jian J

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171120024226.16280-1-jian.j.wang@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox