From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH] x86,seccomp,prctl: Remove PR_TSC_SIGSEGV and seccomp TSC filtering Date: Fri, 3 Oct 2014 22:44:43 +0200 Message-ID: <20141003204443.GP10583@worktop.programming.kicks-ass.net> References: <20141003201409.GM10583@worktop.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Andy Lutomirski Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Ingo Molnar , Kees Cook , Andrea Arcangeli , Erik Bosman , "H. Peter Anvin" , Linux API , Michael Kerrisk-manpages , Paul Mackerras , Arnaldo Carvalho de Melo , X86 ML List-Id: linux-api@vger.kernel.org On Fri, Oct 03, 2014 at 01:27:52PM -0700, Andy Lutomirski wrote: > On Fri, Oct 3, 2014 at 1:22 PM, Andy Lutomirski wrote: > > > > We could make the rule be that RDPMC is enabled if a perf event is > > mmapped or TIF_SECCOMP is clear, but I'd prefer to be convinced that > > there's an actual performance issue first. Ideally we can get this > > all working with no API or ABI change at all. > > No, we can't use that rule. But we could say that RDPMC is enabled if > a perf event is mmapped and no thread in the mm uses seccomp. I'll > grumble a little bit about adding yet another piece of seccomp state. Well, we could simply disable the RDPMC for everything TIF_SECCOMP. Should be fairly straight fwd. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754645AbaJCUow (ORCPT ); Fri, 3 Oct 2014 16:44:52 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:35784 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150AbaJCUot (ORCPT ); Fri, 3 Oct 2014 16:44:49 -0400 Date: Fri, 3 Oct 2014 22:44:43 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: "linux-kernel@vger.kernel.org" , Ingo Molnar , Kees Cook , Andrea Arcangeli , Erik Bosman , "H. Peter Anvin" , Linux API , Michael Kerrisk-manpages , Paul Mackerras , Arnaldo Carvalho de Melo , X86 ML Subject: Re: [PATCH] x86,seccomp,prctl: Remove PR_TSC_SIGSEGV and seccomp TSC filtering Message-ID: <20141003204443.GP10583@worktop.programming.kicks-ass.net> References: <20141003201409.GM10583@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 03, 2014 at 01:27:52PM -0700, Andy Lutomirski wrote: > On Fri, Oct 3, 2014 at 1:22 PM, Andy Lutomirski wrote: > > > > We could make the rule be that RDPMC is enabled if a perf event is > > mmapped or TIF_SECCOMP is clear, but I'd prefer to be convinced that > > there's an actual performance issue first. Ideally we can get this > > all working with no API or ABI change at all. > > No, we can't use that rule. But we could say that RDPMC is enabled if > a perf event is mmapped and no thread in the mm uses seccomp. I'll > grumble a little bit about adding yet another piece of seccomp state. Well, we could simply disable the RDPMC for everything TIF_SECCOMP. Should be fairly straight fwd.