From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752622AbeBPEzd (ORCPT ); Thu, 15 Feb 2018 23:55:33 -0500 Received: from mail-pg0-f43.google.com ([74.125.83.43]:39376 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752450AbeBPEzb (ORCPT ); Thu, 15 Feb 2018 23:55:31 -0500 X-Google-Smtp-Source: AH8x225l63kQabZ17gkm7xY+7nIFTd5JAbYziMZUK6wDLlx9VRQehL75IA0hhxltdQxBU5A/zClJsg== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH RFC v2 4/6] x86: Disable PTI on compatibility mode From: Nadav Amit In-Reply-To: Date: Thu, 15 Feb 2018 20:55:16 -0800 Cc: Linus Torvalds , Pavel Emelyanov , Cyrill Gorcunov , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Dave Hansen , Willy Tarreau , X86 ML , LKML Message-Id: References: <20180215163602.61162-1-namit@vmware.com> <20180215163602.61162-5-namit@vmware.com> <9EB804CA-0EC9-4CBB-965A-F3C8520201E7@gmail.com> To: Andy Lutomirski X-Mailer: Apple Mail (2.3273) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id w1G4tbwM007895 Andy Lutomirski wrote: > On Fri, Feb 16, 2018 at 12:42 AM, Linus Torvalds > wrote: >> On Thu, Feb 15, 2018 at 4:22 PM, Nadav Amit wrote: >>> It is not too pretty, I agree, but it should do the work. There is only one >>> problematic descriptor that can be used to switch from compatibility-mode to >>> long-mode in the GDT (LDT descriptors always have the L-bit cleared). >>> Changing the descriptor's present bit on context switch when needed can do >>> the work. >> >> Sure, I can see it working, but it's some really shady stuff, and now >> the scheduler needs to save/restore/check one more subtle bit. >> >> And if you get it wrong, things will happily work, except you've now >> defeated PTI. But you'll never notice, because you won't be testing >> for it, and the only people who will are the black hats. >> >> This is exactly the "security depends on it being in sync" thing that >> makes me go "eww" about the whole model. Get one thing wrong, and >> you'll blow all the PTI code out of the water. >> >> So now you tried to optimize one small case that most people won't >> use, but the downside is that you may make all our PTI work (and all >> the overhead for all the _normal_ cases) pointless. > > There's also the fact that, if this stuff goes in, we'll be > encouraging people to deploy 32-bit binaries. Then they'll buy > Meltdown-fixed CPUs (or AMD CPUs!) and they may well continue running > 32-bit binaries. Sigh. I'm not totally a fan of this. Ok, ok. Stop kicking the dead body...