Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2565142imu; Mon, 19 Nov 2018 02:36:24 -0800 (PST) X-Google-Smtp-Source: AJdET5f5K/xEotkFKEAigbeyLDy/M/Hi8dcQJk8wFk+y/TnKwCpWx5iJhTekynlKJDph3WioSzcP X-Received: by 2002:a62:4681:: with SMTP id o1-v6mr22623394pfi.172.1542623784869; Mon, 19 Nov 2018 02:36:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542623784; cv=none; d=google.com; s=arc-20160816; b=hDtztfvOiBfrazSuSVGBzOXM9MdoaANmgOEZkWlG9jedKRgGnL3e6bqMQz5niUJ8Hh 2WofBCSqEOFcGHe1mfNEhlmOXgyiB1csu+qaj+NQvYlvDx46Yb2KoXp+2l5ttqaqUpbA U+8vV4Na5GOZ2M9i4JsBCYD3pN+qoYnfHJFjcF4CoMR13jeRRFJcQ0Gc2n3qfPsJkOhQ VrRA2FCetk0mmQ1FMfX1f1GWi2v19Dk/xCV1ABXkrU6Db9DoFYI4aiGpYl1evpJA/mV9 0WQNtu5AvKENMwg3+4+z5zBWyfioTOBDPReQUgPmach142cciUWRnab4s2z1gNt1WLjV AQIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yEH3NVk5Sy4OrpXgt9O8LXlqToyXL9vqKV94leohspQ=; b=qjNWp0Se4mPKERwmC1LJoxFcjhzgx/rWG044I+oprr/Z96qvICks+Q4pMTsJgX78s0 N9HIJnTA/H3cKKJcvo8delNvytLYnp73zZOq22ZVPOiMl1EPSTqhvC1418L3Sfx28j+y a5rDK7ZHuhw5WIea5kGeq+jkl5EzkrOh7fFuS6/pQPLpcE3JFaqwvfYAOis9LUUgdafq /BZQSahjlrAf4eYwZ/JaVAy4icpJBn7lhokm4lcKaBTIkrs+QyzAUBJFm95PykUE45ZV YyyJUoF6tbNaRrdNZUf5veL817SMZiWqk0/4PmY2HaAkKBhe9LWJxHZjuJ7rXVqRJBZJ kdQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Ea7DiH7I; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6si23537688pfc.57.2018.11.19.02.36.10; Mon, 19 Nov 2018 02:36:24 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Ea7DiH7I; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbeKSU5E (ORCPT + 99 others); Mon, 19 Nov 2018 15:57:04 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:34238 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727993AbeKSU5E (ORCPT ); Mon, 19 Nov 2018 15:57:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yEH3NVk5Sy4OrpXgt9O8LXlqToyXL9vqKV94leohspQ=; b=Ea7DiH7Iok2muje/jruSBNErp EoUfr+tXaD1kTSHT83B90uf9x+yzCWOhYmA0tn5AOZgFfIdrzMcSS1ZSyBv20jdQ/j8Yx5pk8RErx tP1qHKmi26ayJBKbgsZWjV5uA0Zuzd8xKhH9VvVemmMqbZ6R2rDUvp/fzYiCo+xWi8PeVWwlnnZAD brBrN5tFZ8jlA15z3jx5th1Aq4KFqF66ZPO+/8gbGh8AvbUFf5nySCnNC0rRzMxABFmQ+2llqNY6J AR/6rWAkacBP/BmYX6iHG8klC0ki1FdDmGYLvkSnlV3rCvEhsLxtjtv1Rb77LSPBY0hluSBZG0Qna ilel+K/zA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOgs7-0003SY-O8; Mon, 19 Nov 2018 10:33:40 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 279F420298C0C; Mon, 19 Nov 2018 11:33:37 +0100 (CET) Date: Mon, 19 Nov 2018 11:33:37 +0100 From: Peter Zijlstra To: Alexey Budankov 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 Subject: Re: [PATCH v1 2/2]: Documentation/admin-guide: introduce perf-security.rst file Message-ID: <20181119103337.GZ9761@hirez.programming.kicks-ass.net> References: <0ac97cd0-4773-fff6-7d4e-74c4a1f076c4@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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