Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S943118AbcJSOpH (ORCPT ); Wed, 19 Oct 2016 10:45:07 -0400 Received: from foss.arm.com ([217.140.101.70]:54036 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S942884AbcJSOpD (ORCPT ); Wed, 19 Oct 2016 10:45:03 -0400 Date: Wed, 19 Oct 2016 10:56:05 +0100 From: Mark Rutland To: Daniel Micay Cc: kernel-hardening@lists.openwall.com, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , "linux-doc@vger.kernel.org" , LKML , Jeff Vander Stoep Subject: Re: [kernel-hardening] [PATCH 1/2] security, perf: allow further restriction of perf_event_open Message-ID: <20161019095605.GD9616@leverpostej> References: <1469630746-32279-1-git-send-email-jeffv@google.com> <20161017134413.GK29095@leverpostej> <1476825301.4032.7.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476825301.4032.7.camel@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1259 Lines: 27 On Tue, Oct 18, 2016 at 05:15:01PM -0400, Daniel Micay wrote: > It's also worth noting that fine-grained control via a scoped > mechanism would likely only be used to implement *more restrictions* > on Android, not to make the feature less aggressive. It's desirable > for perf events to be disabled by default for non-root across the > board on Android. The part that's imperfect is that when a developer > uses a profiling tool, unprivileged usage is automatically enabled > across the board until reboot. Ideally, it would be enabled only for > the scope where it's needed. Sure; understood. > It would be very tricky to implement though, especially without adding > friction, and it would only have value for protecting devices being > used for development. It really doesn't seem to be worth the trouble, > especially since it doesn't persist on reboot. It's only a temporary > security hole and only for developer devices. I can see that for Android this isn't much of a win. It is beneficial elsewhere, and covers a larger set of use-cases. If perf were a filesystem object, we'd only allow access by a given 'perf' group, and that would be sufficient to avoid most of that friction (IIUC). I wonder what we can do that's similar. Thanks, Mark.