From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757504AbcHCPmY (ORCPT ); Wed, 3 Aug 2016 11:42:24 -0400 Received: from mga09.intel.com ([134.134.136.24]:53549 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756582AbcHCPmT convert rfc822-to-8bit (ORCPT ); Wed, 3 Aug 2016 11:42:19 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,466,1464678000"; d="scan'208";a="1019005306" From: "Schaufler, Casey" To: "kernel-hardening@lists.openwall.com" , Kees Cook CC: Jeff Vander Stoep , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , "linux-doc@vger.kernel.org" , LKML , "Jonathan Corbet" , "Eric W. Biederman" Subject: RE: [kernel-hardening] Re: [PATCH 1/2] security, perf: allow further restriction of perf_event_open Thread-Topic: [kernel-hardening] Re: [PATCH 1/2] security, perf: allow further restriction of perf_event_open Thread-Index: AQHR7KOyRQtv+z5eBEu70hhNQE/rkKA2fXoAgAAYC4CAAAXqgIABKtAA//+ZfAA= Date: Wed, 3 Aug 2016 15:42:16 +0000 Message-ID: <99FC4B6EFCEFD44486C35F4C281DC6731F2B9D38@ORSMSX107.amr.corp.intel.com> References: <1469630746-32279-1-git-send-email-jeffv@google.com> <20160802095243.GD6862@twins.programming.kicks-ass.net> <20160802203037.GC6879@twins.programming.kicks-ass.net> <20160803144116.GG6879@twins.programming.kicks-ass.net> In-Reply-To: <20160803144116.GG6879@twins.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGUyNGRiNzEtNWM2My00ZDNhLWE1NGItNGNhMzk5YTcwZmQ1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlJiakN2TnljUUllaGRFUFVKMUcrQ2o4cUYrNndqVk1CYjJyUEl5XC9qWU9zPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Peter Zijlstra [mailto:peterz@infradead.org] > Sent: Wednesday, August 03, 2016 7:41 AM > To: Kees Cook > Cc: Jeff Vander Stoep ; Ingo Molnar ; > Arnaldo Carvalho de Melo ; Alexander Shishkin > ; linux-doc@vger.kernel.org; kernel- > hardening@lists.openwall.com; LKML ; > Jonathan Corbet ; Eric W. Biederman > > Subject: Re: [kernel-hardening] Re: [PATCH 1/2] security, perf: allow further > restriction of perf_event_open > > On Tue, Aug 02, 2016 at 01:51:47PM -0700, Kees Cook wrote: > > Let me take this another way instead. What would be a better way to > > provide a mechanism for system owners to disable perf without an LSM? > > (Since far fewer folks run with an enforcing "big" LSM: I'm seeking as > > wide a coverage as possible.) > > Could something like a new capability bit work? Yes, it could, but we don't have a real good experience with the advanced use of capabilities. The big distros and the "OS"s have yet to adopt them seriously. It's the same sort of issue, really. The granularity gets to you. > I'm thinking that applications that have network connections already > drop all possible capabilities (I know, unlikely to be true, but should > be true for most stuff I hope). This would disable perf for remote code > execution exploits, including web-browsers and the lot. > > It would keep perf working for local stuff by default, although > obviously with pam_cap you can limit this when and where needed. > > For Android this could mean the JVM explicitly dropping the cap for its > 'children' while retaining the use itself. And this would also keep perf > working on the ADB shell stuff. > > > And, I think this would allow a JIT executable to gain the cap using > file caps, even when the user using it doesn't have it, which would keep > things usable even in restricted environments. > > > Or am I misunderstanding capabilities -- which is entirely possible.