Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2863354imu; Mon, 19 Nov 2018 07:15:05 -0800 (PST) X-Google-Smtp-Source: AJdET5cSDKRZQhfor9QhHRh2Df2/KZDhjulbwi1+JLGUiyNELXI57h54jyc5kkVMs8NC3+/pFPKr X-Received: by 2002:a17:902:2b8a:: with SMTP id l10mr13123744plb.70.1542640505427; Mon, 19 Nov 2018 07:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542640505; cv=none; d=google.com; s=arc-20160816; b=CPpyv2En4JcnIZtcpVJAyjQdXMWBKqY6BzxS1jW11bxywPxLC+rtqsNUZj0WJ1MD7e DattaBWaxOaA1gni8/HjPwW286afZ9fSP9zRpweK1rJ2qTh6za1jwsO8wbqvGkvGq35V rwXbdL8i3rejXcOeaD5QZ02lWh5VnOI8cFfZzq9W6STHCZF3ylcMYqY61EpYCv/1BrTR 4KwnefWs5CEimoS6WBmJnAEn6n9sCVtDPK7IU2RfOFhHsuLVPAGNjJGFU7lV3Pt+NugD EAmPLDDP2PQdGOySUUG6akmcewOBvwWJsvYoRRwlxxC7bA0YHk69MSC/V+Q/E/DKFr8W A30Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=40MnIg4kYOnLGFWVZRaORj3QXiBlmoh8BaeJy3Usobw=; b=lOKsyMZTsEdtT9QZKotx39NGbhINkfBgdDsCYYXqtgJXnEbX3zn/aiChza+uCJzDOm pB9dGw2K9Th5RRiRvq9w0JGuVdAhtd/ildeNfl3Of26Fppg0Mg1E+Ai7/NufO7+EPmFR WR1XaapqroVODaccVWHigYQL9qfg33qxSp/cB3BkKUmBNyrR6SlhnQOSqoexzb5U5y9F wd9mrFVArbIj9EKaeCMXmLDGyirgNc76fzlML2cfhg7fQ9Hhbt0gO2+sQREDg3YZKvHA yBBXJ8zsNjWw3b7uK+8OvTZLWG4+QNZMXQ9Cp1GnG7469V8aV/cG8BtXDbUGc+SHdFyz PdZQ== 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 m3si6968906pgc.232.2018.11.19.07.14.39; Mon, 19 Nov 2018 07:15:05 -0800 (PST) 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 S1729801AbeKTBhQ (ORCPT + 99 others); Mon, 19 Nov 2018 20:37:16 -0500 Received: from mga04.intel.com ([192.55.52.120]:23618 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729554AbeKTBhP (ORCPT ); Mon, 19 Nov 2018 20:37:15 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Nov 2018 07:13:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,252,1539673200"; d="scan'208";a="109368805" Received: from linux.intel.com ([10.54.29.200]) by fmsmga001.fm.intel.com with ESMTP; 19 Nov 2018 07:13:22 -0800 Received: from [10.252.27.191] (abudanko-mobl.ccr.corp.intel.com [10.252.27.191]) by linux.intel.com (Postfix) with ESMTP id 83752580460; Mon, 19 Nov 2018 07:13:17 -0800 (PST) Subject: Re: [PATCH v1 2/2]: Documentation/admin-guide: introduce perf-security.rst file To: Peter Zijlstra Cc: Thomas Gleixner , Kees Cook , Jann Horn , Ingo Molnar , Arnaldo Carvalho de Melo , Andi Kleen , Jonatan Corbet , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Mark Rutland , Tvrtko Ursulin , linux-kernel , kernel-hardening@lists.openwall.com, linux-doc@vger.kernel.org References: <0ac97cd0-4773-fff6-7d4e-74c4a1f076c4@linux.intel.com> <20181119103337.GZ9761@hirez.programming.kicks-ass.net> From: Alexey Budankov Organization: Intel Corp. Message-ID: <2a4e0b60-ba52-2d79-ec7d-d9b75f0ae5a1@linux.intel.com> Date: Mon, 19 Nov 2018 18:13:16 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181119103337.GZ9761@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 19.11.2018 13:33, Peter Zijlstra wrote: > On Mon, Nov 19, 2018 at 08:42:52AM +0300, Alexey Budankov wrote: >> >> Implement initial version of perf-security.rst documentation file >> initially covering security concerns related to PCL/Perf performance >> monitoring in multiuser environments. > > Ditch the PCL thing. That's not a term used anywhere in the kernel. Ok. Which is the proper wording to reference to Perf kernel subsystem? > > Also: > >> +PCL/Perf unprivileged users >> +--------------------------- >> + >> +PCL/Perf *scope* and *access* control for unprivileged processes is governed by >> +perf_event_paranoid [2]_ setting: >> + >> +**-1**: >> + Impose no *scope* and *access* restrictions on using PCL performance >> + monitoring. Per-user per-cpu perf_event_mlock_kb [2]_ locking limit is >> + ignored when allocating memory buffers for storing performance data. >> + This is the least secure mode since allowed monitored *scope* is >> + maximized and no PCL specific limits are imposed on *resources* >> + allocated for performance monitoring. >> + >> +**>=0**: >> + *scope* includes per-process and system wide performance monitoring >> + but excludes raw tracepoints and ftrace function tracepoints monitoring. >> + CPU and system events happened when executing either in user or >> + in kernel space can be monitored and captured for later analysis. >> + Per-user per-cpu perf_event_mlock_kb locking limit is imposed but >> + ignored for unprivileged processes with CAP_IPC_LOCK [6]_ capability. >> + >> +**>=1**: >> + *scope* includes per-process performance monitoring only and excludes >> + system wide performance monitoring. CPU and system events happened when >> + executing either in user or in kernel space can be monitored and >> + captured for later analysis. Per-user per-cpu perf_event_mlock_kb >> + locking limit is imposed but ignored for unprivileged processes with >> + CAP_IPC_LOCK capability. >> + >> +**>=2**: >> + *scope* includes per-process performance monitoring only. CPU and system >> + events happened when executing in user space only can be monitored and >> + captured for later analysis. Per-user per-cpu perf_event_mlock_kb >> + locking limit is imposed but ignored for unprivileged processes with >> + CAP_IPC_LOCK capability. >> + >> +**>=3**: >> + Restrict *access* to PCL performance monitoring for unprivileged processes. >> + This is the default on Debian and Android [7]_ , [8]_ . > > that ** crud is unreadable. It can be avoided without missing the sense. "two asterisks: **text** for strong emphasis (boldface)". Thanks, Alexey > > http://lkml.kernel.org/r/094556ca-ea87-9c4a-2115-600d2833fb2a@darmarit.de >