From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 4755D2117AE47 for ; Tue, 23 Oct 2018 07:53:44 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2018 07:53:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,416,1534834800"; d="scan'208";a="80278205" Received: from shwdeopenpsi777.ccr.corp.intel.com ([10.239.158.27]) by fmsmga007.fm.intel.com with ESMTP; 23 Oct 2018 07:53:37 -0700 From: Jian J Wang To: edk2-devel@lists.01.org Date: Tue, 23 Oct 2018 22:53:26 +0800 Message-Id: <20181023145331.5768-1-jian.j.wang@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 Subject: [PATCH v2 0/5] Add freed-memory guard feature X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2018 14:53:45 -0000 > v2 changes: > a. Drop PCD PcdUseAfterFreeDetectionPropertyMask. Use BIT4 of > PcdHeapGuardPropertyMask instead. Add more descriptions about > the new usage in dec/uni file as well. > b. Use global of BOOLEAN other than EFI_LOCK to avoid reentrance > of calling InitializePageTablePool() > c. Update implementation of CoreGetMemorySpaceMap() and > CoreGetIoSpaceMap() to avoid lock failure. Drop the code to > detect debug print level used to achieve the same effect. > d. Change prototype and implementation of IsHeapGuardEnabled() > to allow it to check freed-memory guard feature. > e. Move the sanity check of freed-memory guard and heap guard > into HeapGuardCpuArchProtocolNotify() > f. Add GuardFreedPagesChecked() to avoid duplicate feature check > g. Split patch series into smaller patch files Freed-memory guard is a new feauture used to detect UAF (Use-After-Free) memory issue. Jian J Wang (5): MdeModulePkg/MdeModulePkg.dec: update PCD description for new feature UefiCpuPkg/CpuDxe: fix an infinite loop issue MdeModulePkg/Core: fix a lock issue in GCD memory map dump MdeModulePkg/Core: add freed-memory guard feature MdeModulePkg/Core: fix-up for changes introduced by freed-memory guard MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 140 +++++---- MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 409 +++++++++++++++++++++++++- MdeModulePkg/Core/Dxe/Mem/HeapGuard.h | 63 +++- MdeModulePkg/Core/Dxe/Mem/Page.c | 41 ++- MdeModulePkg/Core/Dxe/Mem/Pool.c | 21 +- MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 2 +- MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c | 16 +- MdeModulePkg/MdeModulePkg.dec | 10 + MdeModulePkg/MdeModulePkg.uni | 6 +- UefiCpuPkg/CpuDxe/CpuDxe.h | 2 +- UefiCpuPkg/CpuDxe/CpuPageTable.c | 19 +- 11 files changed, 640 insertions(+), 89 deletions(-) -- 2.16.2.windows.1