Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752373AbeAJTuv (ORCPT + 1 other); Wed, 10 Jan 2018 14:50:51 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:43676 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751284AbeAJTuu (ORCPT ); Wed, 10 Jan 2018 14:50:50 -0500 X-Google-Smtp-Source: ACJfBos+OZmlgbgetdrZJXUpHJ9kYIvfnSPrDXyWlJ7nqxP0Hlw9ywzS+rknmeV3ARkTgYAIgKY/xwdKObVBKFF3KRE= MIME-Version: 1.0 In-Reply-To: References: <1515502580-12261-1-git-send-email-w@1wt.eu> <1515502580-12261-7-git-send-email-w@1wt.eu> <20180110082207.GX29822@worktop.programming.kicks-ass.net> <20180110091102.GH14066@1wt.eu> From: Linus Torvalds Date: Wed, 10 Jan 2018 11:50:46 -0800 X-Google-Sender-Auth: nTJEB77RHOarDWVeZ_EpHR2MmRM Message-ID: Subject: Re: [RFC PATCH v2 6/6] x86/entry/pti: don't switch PGD on when pti_disable is set To: Andy Lutomirski Cc: Willy Tarreau , Peter Zijlstra , LKML , X86 ML , Borislav Petkov , Brian Gerst , Dave Hansen , Ingo Molnar , Thomas Gleixner , Josh Poimboeuf , "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 Wed, Jan 10, 2018 at 11:21 AM, Andy Lutomirski wrote: > > I really dislike state that isn't cleared on execve(). I'm assuming > that this is so you can run time pwn_me_without_pti whatever? Surely > LD_PRELOAD can do this, too? Andy, what the hell is wrong with you? You are actively trying to screw this whole interface up, aren't you? LD_PRELOAD cannot work for a wrapper, for the simple reason that it runs in the same context as the process. So if you want to say "I want to run this process without PTI", but you don't want to run the process with elevated privileges, LD_PRELOAD doesn't work. It's like saying "why do we need 'sudo' - let's juat make a LD_PRELOAD that sets uid to zero instead". The "let's do it per thread" made no sense either, since that's fundamentally not how page tables work, and it's complete broken shit. And the whole "NOW" vs "NEXT" is complete garbage. The obvious sane no-PTI interface is that it (a) inherits on fork/exec, so that you don't have to worry about how something is implemented (think "I want to run this kernel build without the PTI overhead", but also "I want to run this system daemon without PTI"). (b) actual domain changes clear it (ie suid, whatever). that make it useful for random uses of "I trust service XYZ". So I'm NAK'ing this whole series on the grounds that it has several completely insane semantics and really need to be clarified, and where actual usage needs to be thought about a lot more. Linus