Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754306AbeAGRrS (ORCPT + 1 other); Sun, 7 Jan 2018 12:47:18 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:38719 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754177AbeAGRrR (ORCPT ); Sun, 7 Jan 2018 12:47:17 -0500 Date: Sun, 7 Jan 2018 18:47:14 +0100 From: Willy Tarreau To: Alan Cox Cc: Kiernan Hager , linux-kernel@vger.kernel.org Subject: Re: Avoid speculative indirect calls in kernel Message-ID: <20180107174714.GE9772@1wt.eu> References: <20180104015920.1ad7b9d3@alans-desktop> <1515054014.12987.75.camel@amazon.co.uk> <403e65be-cfd1-fd08-0401-2e26470b63d4@redhat.com> <4dde456c-fd15-e768-8876-5844c8b7c455@redhat.com> <20180107140138.08a7e8e3@alans-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180107140138.08a7e8e3@alans-desktop> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Sun, Jan 07, 2018 at 02:01:38PM +0000, Alan Cox wrote: > > I disagree. When there are patches that slow execution down up to 30%, > > I want to be able to mark a binary as "trusted" so that I can run it > > It's not a binary that is trusted - it's a binary in a given use case. > You could easily have the same binary being run in two situations on the > same box at the same time and run just one of them 'trusted'. That's what I like with the prctl approach. This can end up as a config option in the application itself. At least I'd see it like this in haproxy. Basically : - start it with enough privileges (always the case to warrant chroot() then setuid()) - if config option "disable-kpti" is set, run prctl() to disable it. It is sufficiently inconvenient to ensure that it's only done where relevant and regardless of the executable itself (ie it should not be an xattr on the FS for example). Willy