Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965165AbeAKSv5 (ORCPT + 1 other); Thu, 11 Jan 2018 13:51:57 -0500 Received: from mail-it0-f41.google.com ([209.85.214.41]:46967 "EHLO mail-it0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932703AbeAKSv4 (ORCPT ); Thu, 11 Jan 2018 13:51:56 -0500 X-Google-Smtp-Source: ACJfBotJPSnvgsrJNPxJb+30W90iJNa56Yy+EG4HYOkXKSOYr6COeXj26zA0IUtJRaiNGVQL4ePsjE0sjmgNSPvhsls= MIME-Version: 1.0 In-Reply-To: References: <20180110082207.GX29822@worktop.programming.kicks-ass.net> <20180110091102.GH14066@1wt.eu> <20180111064259.GC14920@1wt.eu> <0f08d89e-61e1-20e3-5c59-0b2f7b32bf0c@linux.intel.com> <20180111154412.GA15296@1wt.eu> <20180111182147.masunghp5km6igjq@ast-mbp.dhcp.thefacebook.com> <20180111183207.dah7imbuvuhvrrk6@treble> From: Linus Torvalds Date: Thu, 11 Jan 2018 10:51:54 -0800 X-Google-Sender-Auth: FDern7lHwkNuOBQIBHvpeMKiwtY Message-ID: Subject: Re: [RFC PATCH v2 6/6] x86/entry/pti: don't switch PGD on when pti_disable is set To: Dave Hansen Cc: Josh Poimboeuf , Alexei Starovoitov , Andy Lutomirski , Willy Tarreau , Peter Zijlstra , LKML , X86 ML , Borislav Petkov , Brian Gerst , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Greg Kroah-Hartman , Kees Cook Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Jan 11, 2018 at 10:38 AM, Dave Hansen wrote: > On 01/11/2018 10:32 AM, Josh Poimboeuf wrote: >>> hmm. Exposing cr3 to user space will make it trivial for user process >>> to know whether kpti is active. Not sure how exploitable such >>> information leak. >> It's already trivial to detect PTI from user space. > > Do tell. One way to do it is to just run the attack, and see if you get something. So it's not really "is PTI enabled", but a "is meltdown there". Then you just use that together with cpuinfo to decide if PTI is enabled. So I think Josh is 100% right. Detecting PTI on/off is not hard. But that does *not* mean that %cr3 isn't secret. %cr3 should definitely never *ever* be accessible to user space. Linus