From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752468AbdLKQZD (ORCPT ); Mon, 11 Dec 2017 11:25:03 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:43641 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836AbdLKQZA (ORCPT ); Mon, 11 Dec 2017 11:25:00 -0500 X-Google-Smtp-Source: ACJfBovebGHdI/eLkxepYhJvbNgrTS6Lhg0bL3m4xhpLrI303h4Xt8g4ME0TYPWE6lvPZq2osdjFWw== Date: Mon, 11 Dec 2017 17:24:57 +0100 From: Ingo Molnar To: Andy Lutomirski Cc: X86 ML , "linux-kernel@vger.kernel.org" , Borislav Petkov , Brian Gerst , David Laight , Kees Cook , Peter Zijlstra Subject: Re: [PATCH PTI v2 3/6] x86/vsyscall/64: Explicitly set _PAGE_USER in the pagetable hierarchy Message-ID: <20171211162457.ppimodxxzdtoono7@gmail.com> References: <20171211133945.pmsgwfj2b5py44gj@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski wrote: > On Mon, Dec 11, 2017 at 5:39 AM, Ingo Molnar wrote: > > > > * Andy Lutomirski wrote: > > > >> The kernel is very erratic as to which pagetables have _PAGE_USER > >> set. The vsyscall page gets lucky: it seems that all of the > >> relevant pagetables are among the apparently arbitrary ones that set > >> _PAGE_USER. Rather than relying on chance, just explicitly set > >> _PAGE_USER. > >> > >> This will let us clean up pagetable setup to stop setting > >> _PAGE_USER. The added code can also be reused by pagetable > >> isolation to manage the _PAGE_USER bit in the usermode tables. > >> > >> Signed-off-by: Andy Lutomirski > >> --- > >> arch/x86/entry/vsyscall/vsyscall_64.c | 33 ++++++++++++++++++++++++++++++++- > >> 1 file changed, 32 insertions(+), 1 deletion(-) > > > > Btw., would it make sense to clean up all this confusion? > > > > In particular a 'KERNEL' pre of post fix is ambiguous in this context I think, and > > the PAGE_KERNEL_ prefix is actively harmful I think and is at the root of the > > confusion. > > > > So if renamed it and used this nomenclature consistently instead: > > > > PAGE_USER_ > > PAGE_SYSTEM_ > > Like _PAGE_USER_VSYSCALL? > > Anyway, that's not the confusion I'm talking about. I'm talking about > _KERNPG_TABLE vs _PAGE_TABLE. The latter should be called > _USERPG_TABLE, and a whole bunch of its users should be switched to > _KERNPG_TABLE. Yeah. > But, since PTI is intended for backporting, I think these types of big > cleanups should wait. Absolutely. Thanks, Ingo