From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A44F9C2BA1B for ; Sun, 5 Apr 2020 14:54:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85DFB206F5 for ; Sun, 5 Apr 2020 14:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726826AbgDEOyp (ORCPT ); Sun, 5 Apr 2020 10:54:45 -0400 Received: from mga06.intel.com ([134.134.136.31]:26201 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726669AbgDEOyo (ORCPT ); Sun, 5 Apr 2020 10:54:44 -0400 IronPort-SDR: 63nSUfSLM8R6twNYzqkNlzzv6yhtWouYrGSUW1Ec17Xrgfo38rApQ/NhWKY39M0VVJ1ZIErQHj icJ3uvPJZQhw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2020 07:54:42 -0700 IronPort-SDR: 6lf1dbhbqIm1OxUs3SWaIp9HMJgDKVQbYm0a/KiLhXqDMOGyyiRLdw8swAzUELjzEHmtzxkleP GJUCDU1xxNHQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,348,1580803200"; d="scan'208";a="424089231" Received: from linux.intel.com ([10.54.29.200]) by orsmga005.jf.intel.com with ESMTP; 05 Apr 2020 07:54:43 -0700 Received: from [10.249.231.111] (abudanko-mobl.ccr.corp.intel.com [10.249.231.111]) by linux.intel.com (Postfix) with ESMTP id 01AF558033E; Sun, 5 Apr 2020 07:54:38 -0700 (PDT) Subject: Re: [PATCH v8 12/12] doc/admin-guide: update kernel.rst with CAP_PERFMON information From: Alexey Budankov To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Alexei Starovoitov , Ingo Molnar , James Morris , Namhyung Kim , Serge Hallyn , Jiri Olsa , Song Liu , Andi Kleen , Stephane Eranian , Igor Lubashev , Thomas Gleixner , linux-kernel , "linux-security-module@vger.kernel.org" , "selinux@vger.kernel.org" , "intel-gfx@lists.freedesktop.org" , "linux-doc@vger.kernel.org" , linux-man@vger.kernel.org References: <84c32383-14a2-fa35-16b6-f9e59bd37240@linux.intel.com> <20200405141029.GA16896@kernel.org> Organization: Intel Corp. Message-ID: <966244a1-2a2d-8e47-b805-2effa46fe8cd@linux.intel.com> Date: Sun, 5 Apr 2020 17:54:37 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On 05.04.2020 17:41, Alexey Budankov wrote: > > On 05.04.2020 17:10, Arnaldo Carvalho de Melo wrote: >> Em Thu, Apr 02, 2020 at 11:54:39AM +0300, Alexey Budankov escreveu: >>> >>> Update kernel.rst documentation file with the information >>> related to usage of CAP_PERFMON capability to secure performance >>> monitoring and observability operations in system. >> >> This one is failing in my perf/core branch, please take a look. I'm Please try applying this: --- Documentation/admin-guide/sysctl/kernel.rst | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst index 335696d3360d..aaa5bbcd1e33 100644 --- a/Documentation/admin-guide/sysctl/kernel.rst +++ b/Documentation/admin-guide/sysctl/kernel.rst @@ -709,7 +709,13 @@ perf_event_paranoid =================== Controls use of the performance events system by unprivileged -users (without CAP_SYS_ADMIN). The default value is 2. +users (without CAP_PERFMON). The default value is 2. + +For backward compatibility reasons access to system performance +monitoring and observability remains open for CAP_SYS_ADMIN +privileged processes but CAP_SYS_ADMIN usage for secure system +performance monitoring and observability operations is discouraged +with respect to CAP_PERFMON use cases. === ================================================================== -1 Allow use of (almost) all events by all users. @@ -718,13 +724,13 @@ users (without CAP_SYS_ADMIN). The default value is 2. ``CAP_IPC_LOCK``. >=0 Disallow ftrace function tracepoint by users without - ``CAP_SYS_ADMIN``. + ``CAP_PERFMON``. - Disallow raw tracepoint access by users without ``CAP_SYS_ADMIN``. + Disallow raw tracepoint access by users without ``CAP_PERFMON``. ->=1 Disallow CPU event access by users without ``CAP_SYS_ADMIN``. +>=1 Disallow CPU event access by users without ``CAP_PERFMON``. ->=2 Disallow kernel profiling by users without ``CAP_SYS_ADMIN``. +>=2 Disallow kernel profiling by users without ``CAP_PERFMON``. === ================================================================== --- Thanks, Alexey > > Trying to reproduce right now. What kind of failure do you see? > Please share some specifics so I could follow up properly. > > Thanks, > Alexey > >> pushing my perf/core branch with this series applied, please check that >> everything is ok, I'll do some testing now, but it all seems ok. >> >> Thanks, >> >> - Arnaldo >> >>> Signed-off-by: Alexey Budankov >>> --- >>> Documentation/admin-guide/sysctl/kernel.rst | 16 +++++++++++----- >>> 1 file changed, 11 insertions(+), 5 deletions(-) >>> >>> diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst >>> index def074807cee..b06ae9389809 100644 >>> --- a/Documentation/admin-guide/sysctl/kernel.rst >>> +++ b/Documentation/admin-guide/sysctl/kernel.rst >>> @@ -720,20 +720,26 @@ perf_event_paranoid: >>> ==================== >>> >>> Controls use of the performance events system by unprivileged >>> -users (without CAP_SYS_ADMIN). The default value is 2. >>> +users (without CAP_PERFMON). The default value is 2. >>> + >>> +For backward compatibility reasons access to system performance >>> +monitoring and observability remains open for CAP_SYS_ADMIN >>> +privileged processes but CAP_SYS_ADMIN usage for secure system >>> +performance monitoring and observability operations is discouraged >>> +with respect to CAP_PERFMON use cases. >>> >>> === ================================================================== >>> -1 Allow use of (almost) all events by all users >>> >>> Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK >>> >>> ->=0 Disallow ftrace function tracepoint by users without CAP_SYS_ADMIN >>> +>=0 Disallow ftrace function tracepoint by users without CAP_PERFMON >>> >>> - Disallow raw tracepoint access by users without CAP_SYS_ADMIN >>> + Disallow raw tracepoint access by users without CAP_PERFMON >>> >>> ->=1 Disallow CPU event access by users without CAP_SYS_ADMIN >>> +>=1 Disallow CPU event access by users without CAP_PERFMON >>> >>> ->=2 Disallow kernel profiling by users without CAP_SYS_ADMIN >>> +>=2 Disallow kernel profiling by users without CAP_PERFMON >>> === ================================================================== >>> >>> >>> -- >>> 2.24.1 >>> >>