Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753826AbeAHR0u (ORCPT + 1 other); Mon, 8 Jan 2018 12:26:50 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:50411 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753786AbeAHR0t (ORCPT ); Mon, 8 Jan 2018 12:26:49 -0500 Date: Mon, 8 Jan 2018 18:26:46 +0100 (CET) From: Thomas Gleixner To: Ingo Molnar cc: Willy Tarreau , linux-kernel@vger.kernel.org, x86@kernel.org, gnomes@lxorguk.ukuu.org.uk, torvalds@linux-foundation.org, Dave Hansen , Andy Lutomirski , Borislav Petkov , Peter Zijlstra , Josh Poimboeuf Subject: Re: [PATCH RFC 2/4] x86/arch_prctl: add ARCH_GET_NOPTI and ARCH_SET_NOPTI to enable/disable PTI In-Reply-To: <20180108171759.qissiwwxyg6m7rrl@gmail.com> Message-ID: References: <1515427939-10999-1-git-send-email-w@1wt.eu> <1515427939-10999-3-git-send-email-w@1wt.eu> <20180108171759.qissiwwxyg6m7rrl@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, 8 Jan 2018, Ingo Molnar wrote: > * Thomas Gleixner wrote: > > Per task is really an odd choice. That should be per process I think, but > > that of course needs synchronization of some form. Aside of that we need to > > think about fork(). > > So per task (thread) is the most natural approach to low level asm flaggery. Well, yes and no. PTI is a property of the mm/pgdir and that's process wide. > Making it per thread also makes some sense conceptually: in a complex > multi-threaded runtime implementation some threads might never execute > 'untrusted' code, some might. No need to penalize the 'server' threads. If one thread runs untrusted code then your 'trusted' thread is not longer trusted either as they share everything. Thanks, tglx