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.88; helo=mga01.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 886A02035624D for ; Mon, 4 Dec 2017 22:22:19 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Dec 2017 22:26:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,363,1508828400"; d="scan'208";a="156169985" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 04 Dec 2017 22:26:48 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 4 Dec 2017 22:26:17 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 4 Dec 2017 22:26:17 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Tue, 5 Dec 2017 14:26:15 +0800 From: "Wang, Jian J" To: "Yao, Jiewen" , "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , "Dong, Eric" Thread-Topic: [edk2] [PATCH v2 0/4] Enable page table write protection Thread-Index: AQHTbNr7XHanUAd61UeqzF6nBcDE0qMyX8mAgACJO7CAAJgkgIAAx/Cw Date: Tue, 5 Dec 2017 06:26:14 +0000 Message-ID: References: <20171204083556.19416-1-jian.j.wang@intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B9BF42B@shsmsx102.ccr.corp.intel.com> <74D8A39837DF1E4DA445A8C0B3885C503AA39A64@shsmsx102.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503AA39A64@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjhlMjIxYTYtYjFhYi00YmQ0LTllM2EtZmY5ODVjOGI4ZTQzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJ4K29cL1BrUG5ZaFJOUmZkMmpZQWN2N3FtTDR5eGw0RnM3U0k3RVU5WFJ3UG8yYXZKZUhacGVYVjl3MzNkWkwzdSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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: Tue, 05 Dec 2017 06:22:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable It's for sharing the pool between the DxeIpl and CpuDxe. If we don't care a= bout=20 wasting a little bit memory, it's ok to drop this definition. CpuDxe can re= serve a block of memory for page table for its own uses. > -----Original Message----- > From: Yao, Jiewen > Sent: Tuesday, December 05, 2017 10:27 AM > To: Wang, Jian J ; Zeng, Star ; > edk2-devel@lists.01.org > Cc: Ni, Ruiyu ; Dong, Eric > Subject: RE: [edk2] [PATCH v2 0/4] Enable page table write protection >=20 > I do not suggest we define PAGE_TABLE_POOL_HEADER. > If we can figure out other way, that will be better. >=20 > Thank you > Yao Jiewen >=20 >=20 > > -----Original Message----- > > From: Wang, Jian J > > Sent: Monday, December 4, 2017 5:26 PM > > To: Zeng, Star ; edk2-devel@lists.01.org > > Cc: Yao, Jiewen ; Ni, Ruiyu ; > Dong, > > Eric > > Subject: RE: [edk2] [PATCH v2 0/4] Enable page table write protection > > > > That means we can't share page table pool between DxeIpl and CpuDxe. If= this > is > > acceptable, I can remove them. > > > > > -----Original Message----- > > > From: Zeng, Star > > > Sent: Monday, December 04, 2017 5:11 PM > > > To: Wang, Jian J ; edk2-devel@lists.01.org > > > Cc: Yao, Jiewen ; Ni, Ruiyu ; > > Dong, > > > Eric ; Zeng, Star > > > Subject: RE: [edk2] [PATCH v2 0/4] Enable page table write protection > > > > > > 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 O= f > 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/CpuDxe. > > > But the memory pages used for page table are not set as read-only in = the > driver > > > 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 p= age > attribute > > > 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 10= 0644 > > > MdeModulePkg/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