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=-6.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 50254C2BA15 for ; Sun, 5 Apr 2020 15:06:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0FD79206B8 for ; Sun, 5 Apr 2020 15:06:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y7HC76M5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726669AbgDEPGC (ORCPT ); Sun, 5 Apr 2020 11:06:02 -0400 Received: from mail-qv1-f65.google.com ([209.85.219.65]:45997 "EHLO mail-qv1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726598AbgDEPGC (ORCPT ); Sun, 5 Apr 2020 11:06:02 -0400 Received: by mail-qv1-f65.google.com with SMTP id g4so6151464qvo.12; Sun, 05 Apr 2020 08:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9N0f+yc5GoSCYnU9CVx853Ppx5E/zoOAAJ8nxJTEFpA=; b=Y7HC76M5hVnZTH8jN1WbAtr84f16u+KO/0nyPseW+pLLAipoydW7pYF+tiVNoF9ltF nbON5GLMf6QRr52JUdP83hAVn+jLhQvGMFWskD4I9BQ4/odgzvrDIxLY1xI9g+yVb4C/ s2cXWLpGSGzf4q/LWNJcl8OkpS52o0e6zCslyw2/Qq1avqM+IwMRvbjeSG8ehkjV1pyP jk0xK8gMfmYrXak7p4ZBSW4h4CSVZrnstU6bREaND652xm4ip4yb8awoWHKWAlDfQN7H 2JukMwQacbyr6AGkGf4X1IAviX6LZpurPEzVRr6WO9rx86RHbTcv8uI2206+v2FhdU+k 1Law== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9N0f+yc5GoSCYnU9CVx853Ppx5E/zoOAAJ8nxJTEFpA=; b=YZM2Ojf0ShWMqlF82rCP5lZSnv1uTVehy3kyEcwJd+BhvcmUyotRpPeTGii2kUjOMt FXEf4ohTqswAa6UUyeRspIASk2g66n25yRsl0Lexhpc++xm15EszBooUnWLPcrVdfQjq mHQPArqMgfw6QShQ5ZePOh9bsevFQYxyEtFGMWPbK86dIt27YGGS2uNo/y8PR+bUkYiA 0Lu9zFbwfM3v/3o+4nOomHnFLd8jq7h+GJXSS4KoPqDEh6N6zlDTlXWwZGWHA0A8efiu R9JtLm5yYNaU6vS9slMlIMRVJ8BydzoNOcYYUOff9ugoCcy0Hqnq/hoVCmKbwSZVaWBY 1Owg== X-Gm-Message-State: AGi0Pubigtbs67Tn9f+VcaumBljo+WU1hOM4eSxzCYOlCK85YNrdhtQ7 akZw5Egw3BTlIa4dzxnTF1A= X-Google-Smtp-Source: APiQypLiZ3GOPWLtLhl8U0huwRiWUGwCKoPM/+nsqylQydejMUMQHHoJEpvfE25ROQ27KYKdEh9uaQ== X-Received: by 2002:a0c:db86:: with SMTP id m6mr16240577qvk.116.1586099160280; Sun, 05 Apr 2020 08:06:00 -0700 (PDT) Received: from quaco.ghostprotocols.net ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id m10sm12655562qte.71.2020.04.05.08.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2020 08:05:59 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 535B0409A3; Sun, 5 Apr 2020 12:05:57 -0300 (-03) Date: Sun, 5 Apr 2020 12:05:57 -0300 To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , 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 Subject: Re: [PATCH v8 12/12] doc/admin-guide: update kernel.rst with CAP_PERFMON information Message-ID: <20200405150557.GP9917@kernel.org> References: <84c32383-14a2-fa35-16b6-f9e59bd37240@linux.intel.com> <20200405141029.GA16896@kernel.org> <966244a1-2a2d-8e47-b805-2effa46fe8cd@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <966244a1-2a2d-8e47-b805-2effa46fe8cd@linux.intel.com> X-Url: http://acmel.wordpress.com Sender: linux-man-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org Em Sun, Apr 05, 2020 at 05:54:37PM +0300, Alexey Budankov escreveu: > > 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: Thanks, applied with the original commit log message, - Arnaldo > --- > 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 > >>> > >> -- - Arnaldo