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=star.zeng@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 1BDE2220EE07C for ; Mon, 4 Dec 2017 01:06:34 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Dec 2017 01:11:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,358,1508828400"; d="scan'208";a="10215061" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 04 Dec 2017 01:11:04 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 4 Dec 2017 01:11:04 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 4 Dec 2017 01:11:03 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.175]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Mon, 4 Dec 2017 17:11:02 +0800 From: "Zeng, Star" To: "Wang, Jian J" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "Ni, Ruiyu" , "Dong, Eric" , "Zeng, Star" Thread-Topic: [edk2] [PATCH v2 0/4] Enable page table write protection Thread-Index: AQHTbNsAIlm4poj7y0G9/fygHZDUF6My5SzA Date: Mon, 4 Dec 2017 09:11:01 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B9BF42B@shsmsx102.ccr.corp.intel.com> References: <20171204083556.19416-1-jian.j.wang@intel.com> In-Reply-To: <20171204083556.19416-1-jian.j.wang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2 0/4] Enable page table write protection 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: Mon, 04 Dec 2017 09:06:35 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Recommend to not introduce the new header file and PCDs as new interfaces, = but handle the page table pool separately in DxeIpl and CpuDxe. Thanks, Star -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jian= J Wang Sent: Monday, December 4, 2017 4:36 PM To: edk2-devel@lists.01.org Subject: [edk2] [PATCH v2 0/4] Enable page table write protection > v2 changes: > a. Enable protection on any newly added page table after DxeIpl. > b. Introduce page table pool concept to make page table allocation > and protection easier and error free. Write Protect feature (CR0.WP) is always enabled in driver UefiCpuPkg/CpuDx= e. But the memory pages used for page table are not set as read-only in the dr= iver DxeIplPeim, after the paging is setup. This might jeopardize the page = table integrity if there's buffer overflow occured in other part of system. This patch series will change this situation by clearing R/W bit in page at= tribute of the pages used as page table. Validation works include booting Windows (10/server 2016) and Linux (Fedora= /Ubuntu) on OVMF and Intel real platform. Jian J Wang (4): MdeModulePkg/MdeModulePkg.dec: Add new PCDs and Guid MdeModulePkg/PageTablePool.h: Page table pool GUID definition file MdeModulePkg/DxeIpl: Mark page table as read-only UefiCpuPkg/CpuDxe: Enable protection for newly added page table MdeModulePkg/Core/DxeIplPeim/DxeIpl.h | 34 +++ MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 3 + MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c | 8 +- MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 315 +++++++++++++++++++= ++- MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h | 15 ++ MdeModulePkg/Include/Guid/PageTablePool.h | 53 ++++ MdeModulePkg/MdeModulePkg.dec | 28 ++ UefiCpuPkg/CpuDxe/CpuDxe.c | 17 +- UefiCpuPkg/CpuDxe/CpuDxe.h | 2 + UefiCpuPkg/CpuDxe/CpuDxe.inf | 3 + UefiCpuPkg/CpuDxe/CpuPageTable.c | 329 +++++++++++++++++++= +++- UefiCpuPkg/CpuDxe/CpuPageTable.h | 22 ++ 12 files changed, 816 insertions(+), 13 deletions(-) create mode 100644 M= deModulePkg/Include/Guid/PageTablePool.h -- 2.14.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel