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
Subject: [PATCH 0/2] Fix issues in Heap Guard
Date: Mon, 11 Dec 2017 09:55:16 +0800	[thread overview]
Message-ID: <20171211015518.9404-1-jian.j.wang@intel.com> (raw)

One issue is that macros defined in HeapGuard.h

    GUARD_HEAP_TYPE_PAGE
    GUARD_HEAP_TYPE_POOL

doesn't match the definition of PCD PcdHeapGuardPropertyMask in
MdeModulePkg.dec. This patch fixed it by exchanging the BIT0 and BIT1
of them.

Another is that method AdjustMemoryF() will return a bigger NumberOfPages than
the value passed in. This is caused by counting twice of a shared Guard page
which can be used for both head and tail Guard of the memory before it and
after it. This happens only when partially freeing just one page in the middle
of a bunch of allocated pages. The freed page should be turned into a new
Guard page.

Since the most part code of Heap Guard feature are almost the same,
PiSmmCore and DxeCore have both above issues. This patch series fix them all.

Jian J Wang (2):
  MdeModulePkg/DxeCore: Fix issues in Heap Guard
  MdeModulePkg/PiSmmCore: Fix issues in Heap Guard

 MdeModulePkg/Core/Dxe/Mem/HeapGuard.c   | 93 ++++++++++++++++++++++++++-------
 MdeModulePkg/Core/Dxe/Mem/HeapGuard.h   |  4 +-
 MdeModulePkg/Core/Dxe/Mem/Page.c        | 15 +++---
 MdeModulePkg/Core/Dxe/Mem/Pool.c        |  4 +-
 MdeModulePkg/Core/PiSmmCore/HeapGuard.c | 91 ++++++++++++++++++++++++++------
 MdeModulePkg/Core/PiSmmCore/HeapGuard.h |  4 +-
 6 files changed, 164 insertions(+), 47 deletions(-)

-- 
2.15.1.windows.2



             reply	other threads:[~2017-12-11  1:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11  1:55 Jian J Wang [this message]
2017-12-11  1:55 ` [PATCH 1/2] MdeModulePkg/DxeCore: Fix issues in Heap Guard Jian J Wang
2017-12-11  1:55 ` [PATCH 2/2] MdeModulePkg/PiSmmCore: " Jian J Wang
2017-12-12  2:56 ` [PATCH 0/2] " Zeng, Star

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=20171211015518.9404-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