Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp237173imm; Thu, 14 Jun 2018 19:11:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL/TNCi4zb/xtx8kBX6rkAs9Lx4wnXuSH1f4BApk6qfaX+70MlT1W73+MXzAoYwo9QxoGFZ X-Received: by 2002:a63:6e44:: with SMTP id j65-v6mr4527441pgc.14.1529028699348; Thu, 14 Jun 2018 19:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529028699; cv=none; d=google.com; s=arc-20160816; b=QpztiRRYCx+XZC7csEOjK8Z8rl6bj91P195nve1v0EXJz/raBezOaMqetAz2G2VuHe UCFJFwZI5TixMg4wMjtJjIlz+PQe0NYpcrbq2eeudNtBqb8HBoufZppQidgNgcilBLAL UQy2fae5f47KraQZGJrHzjY+HzSDYjxvWga4zYFjrOqbEVSKXrq1z40jaSdRm9mo340j gc2I4Fwal6B3LWC9+cGz7Uqt54y4ftQGMSnYEq9ZYjCTVYCL0STkcapKNIrfH5icg2e/ GlDz9kHev3fpcZTF+PvlyAF5CrvI82fpLwVyQTimp+fcu3iGihpVMxB+rxbFt5OK31ha hQiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=C2SxU0KSU6HcEKVylc4PdIrE6hJ5hpCEWpEotB9p4Bo=; b=xPYz+R0nSZqZw7gLtNzrMdoYhDL2hZ9wITjedBou1JpJ7XhJ0Zg+9WJ4JjHNfOXphM EKtUnxWA0DDhTID4EcYBddkz+U0XE0VBaEO//b30FZdtauP9VQBVyk2RSlIwU6r/WIVr 3tH9CFfnafw48RHlnpZ2BSE3prkJkWhNL0bthDZQ6lDh8NrNjyXbLYMIKa9JT47Z8UI4 xqtM0aQlekqF4PrG2wye8n1XzCKw8lAmszFC6c0YOoqUD4mB8UvhnBXVfjQ6c1ross+1 PYOCJbCUrMUS9ezWRIWg/GXk0dkpyfmaWdpzwllb9gHwY5UjPklmux6hT2kIXeuP0z5N s+Dg== 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 29-v6si6669156pfs.40.2018.06.14.19.11.25; Thu, 14 Jun 2018 19:11:39 -0700 (PDT) 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 S965457AbeFOCKH (ORCPT + 99 others); Thu, 14 Jun 2018 22:10:07 -0400 Received: from mga18.intel.com ([134.134.136.126]:54467 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965072AbeFOCKE (ORCPT ); Thu, 14 Jun 2018 22:10:04 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jun 2018 19:10:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,225,1526367600"; d="scan'208";a="49141623" Received: from skl.sh.intel.com ([10.239.161.125]) by orsmga007.jf.intel.com with ESMTP; 14 Jun 2018 19:10:01 -0700 From: Jin Yao To: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, me@kylehuey.com Cc: Linux-kernel@vger.kernel.org, vincent.weaver@maine.edu, will.deacon@arm.com, eranian@google.com, namhyung@kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, Jin Yao Subject: [PATCH v1 2/2] perf Documentation: Introduce the sysctl perf_allow_sample_leakage Date: Fri, 15 Jun 2018 18:03:23 +0800 Message-Id: <1529057003-2212-3-git-send-email-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529057003-2212-1-git-send-email-yao.jin@linux.intel.com> References: <1529057003-2212-1-git-send-email-yao.jin@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce a new sysctl /sys/devices/cpu/perf_allow_sample_leakage, which turns on/off dropping leaked kernel samples. Signed-off-by: Jin Yao --- tools/perf/Documentation/perf-record.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 04168da..97fb0f8 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -93,6 +93,20 @@ OPTIONS prevent the shell interpretation. You also need to use --group on "perf report" to view group events together. + Note that if workload does a lot of kernel entry/exit we may see + kernel samples even if :u is specified. That is due to skid existing. + This might be a security issue because it can leak kernel address even + though kernel sampling support is disabled. We have a sysctl to turn + on/off the dropping of leaked kernel samples. + + /sys/devices/cpu/perf_allow_sample_leakage + + 0 - drop the leaked kernel samples, default option. + 1 - don't drop the leaked kernel samples. + + For example, write 1 to perf_allow_sample_leakage + echo 1 > /sys/devices/cpu/perf_allow_sample_leakage + --filter=:: Event filter. This option should follow a event selector (-e) which selects either tracepoint event(s) or a hardware trace PMU -- 2.7.4