public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix issues in Heap Guard
@ 2017-12-11  1:55 Jian J Wang
  2017-12-11  1:55 ` [PATCH 1/2] MdeModulePkg/DxeCore: " Jian J Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jian J Wang @ 2017-12-11  1:55 UTC (permalink / raw)
  To: edk2-devel

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-12  2:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-11  1:55 [PATCH 0/2] Fix issues in Heap Guard Jian J Wang
2017-12-11  1:55 ` [PATCH 1/2] MdeModulePkg/DxeCore: " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox