[edk2] [PATCH 0/2] fix DXE memory free issue in SMM mode

Jian J Wang posted 2 patches 5 years, 10 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
MdeModulePkg/Core/Dxe/Mem/HeapGuard.c |  10 ----
UefiCpuPkg/CpuDxe/CpuDxe.c            |   2 +-
UefiCpuPkg/CpuDxe/CpuDxe.inf          |   1 +
UefiCpuPkg/CpuDxe/CpuPageTable.c      | 108 +++++++++++++++++++++++-----------
4 files changed, 75 insertions(+), 46 deletions(-)
[edk2] [PATCH 0/2] fix DXE memory free issue in SMM mode
Posted by Jian J Wang 5 years, 10 months ago
This patch series try to fix an issue caused by trying to free memory
allocated in DXE but freed in SMM mode. This happens only if Heap
Guard feature is enabled, which needs to update page table. The root
cause is that DXE and SMM don't share the same paging configuration
but CpuDxe driver still tries to access page table through current
processor registers (CR3) in SMM mode, during memory free opration in
DXE core. This will cause DXE core got the incorrect paging attributes
of memory to be freed, and then fail the free operation.

The solution is let CpuDxe store the paging configuration in a global
variable and use it to access DXE page table if in SMM mode.

Jian J Wang (2):
  UefiCpuPkg/CpuDxe: allow accessing (DXE) page table in SMM mode
  MdeModulePkg/Core: remove SMM check for Heap Guard feature detection

 MdeModulePkg/Core/Dxe/Mem/HeapGuard.c |  10 ----
 UefiCpuPkg/CpuDxe/CpuDxe.c            |   2 +-
 UefiCpuPkg/CpuDxe/CpuDxe.inf          |   1 +
 UefiCpuPkg/CpuDxe/CpuPageTable.c      | 108 +++++++++++++++++++++++-----------
 4 files changed, 75 insertions(+), 46 deletions(-)

-- 
2.16.2.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel