Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1014649imm; Fri, 28 Sep 2018 10:24:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV61YX6QpKzpAXdjytSsLQ7hWLIxDwp10LdFFp+cyz+GLdGkeYSo7hnIp/jJ1iBZF8oo/Q1vu X-Received: by 2002:a17:902:506:: with SMTP id 6-v6mr17431581plf.132.1538155448872; Fri, 28 Sep 2018 10:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538155448; cv=none; d=google.com; s=arc-20160816; b=pcqwxxtEpgJ0bs3YkUtFymO1mnOXo6l0/VMrZvqwxHtKqDB+btyUfDn2RFyyD2OMJf 7htTwRWvD4pny2pMpJSB0stdL6ZYVkM0yly/PFtug6yCk0cnvWudlDvzbF2tLBc/1T1n 05Yl7U2qiC1O9YZ0kqS0pA9xm57GOfFGmY/HCDTZxtKlhfKpe+zVX+lD+HhRKB3lDXCE hW0lT0bxHgmRvAKhatxv/rDRAWaEJ4X6O0oZXqevd4BF8UmLWIIKo1gUgTqdctUVpAKd 9bq87QU/CKx6s5Hx7+Py7kVa4R6dEx89LqH6AAMAIfKEopKHx3JduoLO6By6p0Z8JDA1 imhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=TPAZZExn0VO8JM5hkGtlLhmYDKqxdntT5r2I3+efKUo=; b=ea1BhafJXgOkcxVBv171v2fClEKKFPFGCIty1v+I0ylGIG+D1RQfo3z381rV2v+usS o/21btExRMHt/OPe/GLVnx65brGryy3jUa4GbcWy2fWj/Eke6buI4tYjfGzmvJbnWOii aWMtjZB7QyVk/QzOxpW2WI+yXa7wCMVhM+H3o0HWjKSIN0quDWWz/AdP+NeTG3+ui7tQ vToi3+eYr0kD3JfsU2egvf0SzygvUi3f7AxLDYVNSo/ORQPXW4WB2QicScsjcoI17Tno QwYtQQHe7VF+JqXKzX4a41UPgBYtOzU/ArPW2CMFQNocq47EjhAMaWVJhPcPnmT/qaXR jflQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e92-v6si1910264pld.358.2018.09.28.10.23.52; Fri, 28 Sep 2018 10:24:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729468AbeI1Xs0 (ORCPT + 99 others); Fri, 28 Sep 2018 19:48:26 -0400 Received: from mga05.intel.com ([192.55.52.43]:19238 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbeI1Xs0 (ORCPT ); Fri, 28 Sep 2018 19:48:26 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Sep 2018 10:23:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,315,1534834800"; d="scan'208";a="77203532" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.126]) by orsmga008.jf.intel.com with ESMTP; 28 Sep 2018 10:23:40 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 9A539300B51; Fri, 28 Sep 2018 10:23:40 -0700 (PDT) Date: Fri, 28 Sep 2018 10:23:40 -0700 From: Andi Kleen To: Mark Rutland Cc: Thomas Gleixner , Tvrtko Ursulin , LKML , tvrtko.ursulin@linux.intel.com, Peter Zijlstra , x86@kernel.org, "H. Peter Anvin" , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Madhavan Srinivasan , Alexey Budankov , Kees Cook , Jann Horn Subject: Re: [RFC 0/5] perf: Per PMU access controls (paranoid setting) Message-ID: <20180928172340.GA32651@tassilo.jf.intel.com> References: <20180919122751.12439-1-tvrtko.ursulin@linux.intel.com> <20180928164111.i6nba2j6mnegwslw@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180928164111.i6nba2j6mnegwslw@lakrids.cambridge.arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > There's also been prior discussion on these feature in other contexts > (e.g. android expoits resulting from out-of-tree drivers). It would be > nice to see those considered. > > IIRC The conclusion from prior discussions (e.g. [1]) was that we wanted > finer granularity of control such that we could limit PMU access to > specific users -- e.g. disallow arbitrary android apps from poking *any* > PMU, while allowing some more trusted apps/users to uses *some* specific > PMUs. > > e.g. we could add /sys/bus/event_source/devices/${PMU}/device, protect > this via the usual fs ACLs, and pass the fd to perf_event_open() > somehow. A valid fd would act as a capability, taking precedence over > perf_event_paranoid. That sounds like an orthogonal feature. I don't think the original patchkit would need to be hold up for this. It would be something in addition. BTW can't you already do that with the syscall filter? I assume the Android sandboxes already use that. Just forbid perf_event_open for the apps. -Andi