audk/MdeModulePkg
Jian J Wang 63ebde8ef6 MdeModulePkg/Core: add freed-memory guard feature
Freed-memory guard is used to detect UAF (Use-After-Free) memory issue
which is illegal access to memory which has been freed. The principle
behind is similar to pool guard feature, that is we'll turn all pool
memory allocation to page allocation and mark them to be not-present
once they are freed.

This also implies that, once a page is allocated and freed, it cannot
be re-allocated. This will bring another issue, which is that there's
risk that memory space will be used out. To address it, the memory
service add logic to put part (at most 64 pages a time) of freed pages
back into page pool, so that the memory service can still have memory
to allocate, when all memory space have been allocated once. This is
called memory promotion. The promoted pages are always from the eldest
pages which haven been freed.

This feature brings another problem is that memory map descriptors will
be increased enormously (200+ -> 2000+). One of change in this patch
is to update MergeMemoryMap() in file PropertiesTable.c to allow merge
freed pages back into the memory map. Now the number can stay at around
510.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-10-26 10:30:35 +08:00
..
Application MdeModulePkg CapsuleApp:Remove two redundant Guids 2018-09-21 11:34:42 +08:00
Bus MdeModulePkg/NvmExpressDxe: Refine PassThru IO queue creation behavior 2018-10-25 12:41:37 +08:00
Core MdeModulePkg/Core: add freed-memory guard feature 2018-10-26 10:30:35 +08:00
Include MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
Library MdeModulePkg BrotliDecompressLib: Add the checker to avoid array out of bound 2018-10-19 08:21:47 +08:00
Logo MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
Universal MdeModulePkg/UdfDxe: Avoid possible use of already-freed data 2018-10-23 14:25:04 +08:00
MdeModulePkg.dec MdeModulePkg: introduce UEFI freed-memory guard bit in HeapGuard PCD 2018-10-26 10:27:20 +08:00
MdeModulePkg.dsc MdeModulePkg BrotliCustomDecompressLib: Don't build it for EBC arch 2018-10-15 15:55:55 +08:00
MdeModulePkg.uni MdeModulePkg: introduce UEFI freed-memory guard bit in HeapGuard PCD 2018-10-26 10:27:20 +08:00
MdeModulePkgExtra.uni MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00