Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1507550ybz; Thu, 30 Apr 2020 00:08:40 -0700 (PDT) X-Google-Smtp-Source: APiQypLqHcLXD3vLmxPbw+HEf7JQsfZ6WvV/0QqAuMIj1ghqEX5NG6llDP+ZYVr4E2hMP6N0ugEn X-Received: by 2002:aa7:d2cd:: with SMTP id k13mr1422010edr.116.1588230520546; Thu, 30 Apr 2020 00:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588230520; cv=none; d=google.com; s=arc-20160816; b=mDxI2T1MNRK5kmkQ5o4lKghLzqaWH82O8kPuPqmCF7rVPz1WPhp3M3wkTGbCylh2ya 1PcdstJxankRQiVh8OX0ZVGfCIsUeHfW58eeK8EwAUIRXAcGEkKBgXVLwVJA/XWJn9SA MdknuEfzHURb085XSecug4M73Nyy9JcAukPnCOY4b5qj2O2rJB3YxxaM0gDAH29JGcZ7 bsZIxcOkwtpwu07+1Vf6X+/rD90wvQq/kK8GZGyU3jLba9LBMlQNW/xz+fBT0ZaqV4ZW pKOw6Gk2YNwn/BXAsRZrON/xkCOtz3ZUUmM6wI5zIAlboSwrGWoCtLGRI1WD1YsF83D3 RTBQ== 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:mime-version:user-agent:date:message-id :organization:subject:from:cc:to:ironport-sdr:ironport-sdr; bh=yYNwIBjY5tA6tzG1ZJbyHDc+4l9l3VonDcgiFQHkbso=; b=NjRJHJxnX5yY4UUle5pHvuoQYx5t0qjf589MkPzXaFrk16oiAhKUwPJ1ZZHAJwhC5S 5z+dlWxE6680UMWmrCFWGQzp9i8jglfHShr/TTvDpUa3Oh3xHFDIDq9a4fVVM6dlvgfQ MaKsVJaNxcCjRlh57Cdixq+9negBmcOvD6YWRUYpaThS2rVT/gwCGhzW9QH7h/ijYgX6 cg3ymNeVDFiSx0C7vZ+oF5EMjGrV5q2J1iECh5AWmMZN+ocRrpfRspkPgmMxahtH8bs2 aocjdx+iQxic9BSwDNNb1qZLuLgpGSn2JsxrequVrlmI6lxRoW6LkwE1hbiaWR48FOkh mAqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id c9si5313061ejs.56.2020.04.30.00.08.16; Thu, 30 Apr 2020 00:08:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726669AbgD3HGP (ORCPT + 99 others); Thu, 30 Apr 2020 03:06:15 -0400 Received: from mga02.intel.com ([134.134.136.20]:61847 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbgD3HGP (ORCPT ); Thu, 30 Apr 2020 03:06:15 -0400 IronPort-SDR: 0lLxilEP3MBfG6/ju6yRMgN7XfxuxR7Ij77Zvas51LFL/g+rQdlgVHKqD7iR9QmDKglOEvxYIt 01G48krbpJlw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2020 00:06:14 -0700 IronPort-SDR: djF39Bs3TB+mKFqavxnijNCI33yhlWYCDroujdcd3oTEbXyDLnhavuiHjelHtcf7sIyLtlPr6p oD1NJEERE8fA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,334,1583222400"; d="scan'208";a="248196369" Received: from linux.intel.com ([10.54.29.200]) by fmsmga007.fm.intel.com with ESMTP; 30 Apr 2020 00:06:13 -0700 Received: from [10.249.229.126] (bababaya-mobl.ccr.corp.intel.com [10.249.229.126]) by linux.intel.com (Postfix) with ESMTP id 1C8035805EB; Thu, 30 Apr 2020 00:06:10 -0700 (PDT) To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel , "selinux@vger.kernel.org" , "linux-security-module@vger.kernel.org" From: Alexey Budankov Subject: [PATCH v3 0/3] perf: make Perf tool aware of SELinux access control Organization: Intel Corp. Message-ID: <0fffd9e2-1f22-a0c2-c2e3-cb7f4bb89d66@linux.intel.com> Date: Thu, 30 Apr 2020 10:06:09 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 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 Changes in v3: - mention "CAP_PERFMON or CAP_SYS_ADMIN" instead of sole CAP_PERFMON or CAP_SYS_ADMIN capability in the docs and messages to support use case of newer Perf tool on kernel w/o CAP_PERFMON - reverted double new line in "No permission to enable %s event.\n\n" - updated security.txt content with new messages wording v2: https://lore.kernel.org/lkml/66f2975b-4a69-b428-7dc5-d9aa40b3c673@linux.intel.com/ Changes in v2: - implemented minor doc and code changes to substitute CAP_SYS_ADMIN with CAP_PERFMON capability; - introduced Perf doc file with instructions on how to enable and use perf_event LSM hooks for mandatory access control to perf_event_open() syscall; v1: https://lore.kernel.org/lkml/b8a0669e-36e4-a0e8-fd35-3dbd890d2170@linux.intel.com/ repo: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git perf/core sha1: ee097e8ee56f8867cbbf45fe2a06f6b9e660c39c Extend Perf tool with the check of /sys/fs/selinux/enforce value and notify in case access to perf_event_open() syscall is restricted by the enforced SELinux policy settings. See new added security.txt file for exact steps how the changes look like and how to test the patch set. --- Alexey Budankov (3): perf docs: extend CAP_SYS_ADMIN with CAP_PERFMON where needed perf tool: make Perf tool aware of SELinux access control perf docs: introduce security.txt file to document related issues tools/perf/Documentation/perf-intel-pt.txt | 2 +- tools/perf/Documentation/security.txt | 237 +++++++++++++++++++++ tools/perf/util/cloexec.c | 4 +- tools/perf/util/evsel.c | 39 ++-- 4 files changed, 264 insertions(+), 18 deletions(-) create mode 100644 tools/perf/Documentation/security.txt -- 2.24.1