From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E3E2421EA15D5 for ; Tue, 10 Oct 2017 20:15:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2017 20:18:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,359,1503385200"; d="scan'208";a="145091199" Received: from jwang36-mobl2.ccr.corp.intel.com ([10.239.192.48]) by orsmga002.jf.intel.com with ESMTP; 10 Oct 2017 20:18:30 -0700 From: Jian J Wang To: edk2-devel@lists.01.org Cc: Star Zeng , Eric Dong , Jiewen Yao , Michael Kinney , Ayellet Wolman Date: Wed, 11 Oct 2017 11:18:19 +0800 Message-Id: <20171011031824.17060-1-jian.j.wang@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 Subject: [PATCH 0/5] Implement heap guard feature X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 03:15:04 -0000 This feature makes use of paging mechanism to add a hidden (not present) page just before and after the allocated memory block. If the code tries to access memory outside of the allocated part, page fault exception will be triggered. This feature is disabled by default and is not recommended to enable it in production build of BIOS. Cc: Star Zeng Cc: Eric Dong Cc: Jiewen Yao Cc: Michael Kinney Cc: Ayellet Wolman Suggested-by: Ayellet Wolman Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang Jian J Wang (5): MdeModulePkg/DxeCore: Implement heap guard feature for UEFI MdeModulePkg/PiSmmCore: Implement heap guard feature for SMM mode MdeModulePkg/MdeModulePkg.dec,.uni: Add heap guard related PCDs and string tokens UefiCpuPkg/CpuDxe: Reduce debug message UefiCpuPkg/PiSmmCpuDxeSmm: Disable page table protection MdeModulePkg/Core/Dxe/DxeMain.inf | 4 + MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 1171 +++++++++++++++++++++ MdeModulePkg/Core/Dxe/Mem/HeapGuard.h | 391 +++++++ MdeModulePkg/Core/Dxe/Mem/Imem.h | 38 +- MdeModulePkg/Core/Dxe/Mem/Page.c | 129 ++- MdeModulePkg/Core/Dxe/Mem/Pool.c | 154 ++- MdeModulePkg/Core/PiSmmCore/Misc/HeapGuard.c | 1438 ++++++++++++++++++++++++++ MdeModulePkg/Core/PiSmmCore/Misc/HeapGuard.h | 395 +++++++ MdeModulePkg/Core/PiSmmCore/Misc/PageTable.c | 704 +++++++++++++ MdeModulePkg/Core/PiSmmCore/Misc/PageTable.h | 174 ++++ MdeModulePkg/Core/PiSmmCore/Page.c | 51 +- MdeModulePkg/Core/PiSmmCore/PiSmmCore.c | 12 +- MdeModulePkg/Core/PiSmmCore/PiSmmCore.h | 80 +- MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf | 8 + MdeModulePkg/Core/PiSmmCore/Pool.c | 77 +- MdeModulePkg/MdeModulePkg.dec | 57 + MdeModulePkg/MdeModulePkg.uni | 58 ++ UefiCpuPkg/CpuDxe/CpuPageTable.c | 5 +- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 1 + UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c | 2 +- 20 files changed, 4854 insertions(+), 95 deletions(-) create mode 100644 MdeModulePkg/Core/Dxe/Mem/HeapGuard.c create mode 100644 MdeModulePkg/Core/Dxe/Mem/HeapGuard.h create mode 100644 MdeModulePkg/Core/PiSmmCore/Misc/HeapGuard.c create mode 100644 MdeModulePkg/Core/PiSmmCore/Misc/HeapGuard.h create mode 100644 MdeModulePkg/Core/PiSmmCore/Misc/PageTable.c create mode 100644 MdeModulePkg/Core/PiSmmCore/Misc/PageTable.h -- 2.14.1.windows.1