Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp419590imu; Tue, 27 Nov 2018 00:23:38 -0800 (PST) X-Google-Smtp-Source: AFSGD/W3GeHhrHgai4zXvt4L8sMf+fxsYG/Hta0fvgHpnmMJ3rWxt2PBjWbok68gD03F3ZZz6f7W X-Received: by 2002:a17:902:6b0c:: with SMTP id o12mr31834750plk.291.1543307018778; Tue, 27 Nov 2018 00:23:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543307018; cv=none; d=google.com; s=arc-20160816; b=XMgWdwk/dbxrTB6YdxWIIOLWLWUqBxAXGD9LxSKgvDcOyCyLneNHevso/9r6U6bCsP hnuC+2x6LdWmch+39vBRIa10yJvbDP88Uw6QnUGsjv/kbFyWhGjeRy5ii9N+xlN2gDk3 8+tAQFgfk0kngFaR/n4kP3+wgCCDANIKvx6Dygwzon6/E6baChsqZczTCTFm4vLVFQGX nxGCnKCu6B0gGQGZw1ng78NijaI1JPDeNKZphgR4JO79hIRXKxnMSbvS9xVrUH7JmPGH gSyKskDOJ5cRqosS1vXyRgQpYagqUcG3rkxpiUZxZmM+wHZ8xY7E1enNPyh5UhSEZyZO Ix+Q== 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=kKUJw0OAbiJs1p9B0jdVjzfBAVLge2BzM4daMTNhV5c=; b=YEABcACqvT/Nq0V/gTbVfCsNVDPbQXfoIiW4/w8ZWTyqQ+2wbQqnYQmT29bagq1ikm pBgw2niUC/W0v4BEv7umMQto26Q6dYmBgQfbXH6ttpw3mFf+MvR3zuzloxT1zSZv9+iC CP+IBDKuLtGB/RfIYplvwpFWUiwd81l2bmaLrmVoNjS5WNcXgm0lv96+/rO+HRIiHOjx W9N3bjydon4v7qOWwGT01t4GLwj52LPvIdkXPSBFEBeg5NiIhorOokksu2CTZpD2WbRR JJbZRV6zc8vE71Q3P3ByM7QSB2VgMNGwHcFRZvW1CAbOHQGJMgeAithIccdrMPM2HAtO ZaCA== 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 v30si3034997pga.45.2018.11.27.00.23.22; Tue, 27 Nov 2018 00:23:38 -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 S1729430AbeK0TOL (ORCPT + 99 others); Tue, 27 Nov 2018 14:14:11 -0500 Received: from mga01.intel.com ([192.55.52.88]:24335 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728976AbeK0TOK (ORCPT ); Tue, 27 Nov 2018 14:14:10 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Nov 2018 00:17:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,286,1539673200"; d="scan'208";a="284798233" Received: from linux.intel.com ([10.54.29.200]) by fmsmga005.fm.intel.com with ESMTP; 27 Nov 2018 00:17:04 -0800 Received: from [10.125.251.223] (abudanko-mobl.ccr.corp.intel.com [10.125.251.223]) by linux.intel.com (Postfix) with ESMTP id 7B7225803C2; Tue, 27 Nov 2018 00:17:01 -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: Date: Tue, 27 Nov 2018 11:17:00 +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. Addressed. Please see v4. > > 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. > > http://lkml.kernel.org/r/094556ca-ea87-9c4a-2115-600d2833fb2a@darmarit.de > Addressed. Please see v4. Thanks, Alexey