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=unavailable 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 4D0DEC2BA17 for ; Sun, 5 Apr 2020 14:54:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D6A6206C3 for ; Sun, 5 Apr 2020 14:54:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D6A6206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B3F316E0F3; Sun, 5 Apr 2020 14:54:45 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 55D6D6E0F3 for ; Sun, 5 Apr 2020 14:54:44 +0000 (UTC) IronPort-SDR: yLQrBuwGkkJABEdA/H3aPPVGWBpsXmD+iRAG9F7xz3UpbMfJ+pwx0kdA8OOid6Ju6dlPGVCwQa U7kKTv1i/T9w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2020 07:54:43 -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) From: Alexey Budankov To: Arnaldo Carvalho de Melo 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-Language: en-US Subject: Re: [Intel-gfx] [PATCH v8 12/12] doc/admin-guide: update kernel.rst with CAP_PERFMON information X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-man@vger.kernel.org, Song Liu , Andi Kleen , "linux-doc@vger.kernel.org" , Peter Zijlstra , linux-kernel , "intel-gfx@lists.freedesktop.org" , Igor Lubashev , Alexei Starovoitov , Stephane Eranian , James Morris , "selinux@vger.kernel.org" , "linux-security-module@vger.kernel.org" , Ingo Molnar , Namhyung Kim , Thomas Gleixner , Jiri Olsa , Serge Hallyn Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 >>> >> _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx