Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp237386imm; Thu, 14 Jun 2018 19:11:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJWB43ore2gpmCJ4O8g34uVWGqXkjBRpaxHkQ8h2KESuuendRHPsxMiqo/UUEaP6FpddQ3/ X-Received: by 2002:a63:3581:: with SMTP id c123-v6mr4380561pga.217.1529028715996; Thu, 14 Jun 2018 19:11:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529028715; cv=none; d=google.com; s=arc-20160816; b=Njm5Dw4odhRhbStMB4Ca6EzIT5dCdSJTLI6hSl58l3Bbv01afvNZGkzJAMCmmVKnF/ h1Mvjzk5WlGInir9G/5KvADMPw0s/LrSe6/lnwP56gAIdOsnboe8gBsqqjKJj1J2AtE4 aFsado29IZ6b68/BgxIARH2PaCXwSdsFJOR/U68StjjUYqHVuMpV8wPHC+MVACKDj2M3 jM35y5t9G35JWUbnQJ4tYIpY8clJNyrlH8JGxHRm8DZYx18KB8BCWOugJPgg6xndbrf1 6U3PT/hH2qfJiZNXuDSMm9L0M3fjm7SyD5yD0dFsJJV4RgFGWFJDXGtXuz+AgGUEUWvN /OrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=XKg5rNUJ6VtRVXKcvWp5iP3qFElxU4eCUR50I8/OLjQ=; b=gsCDtPo8FG3n+m3Zj5hCJckaDamz3dv0M4tRhyHiM5A+xszhIQxHsERFXmn0MSFOAj GEML7fSIy03/ZWMJoBXZpUIMYIpQxWt+1txqXTeNnDKGuppMyOvx0vl8wag7tGLfiKoF PpHYS+6AqeGbtpDYHqmQ5v/YNdsJHu4mMkWC1s4zr89jh1wxjhX8oBasLI/cfG0GVyPP QNzeg4i7eeIM8kl9SfOzKQ0RhKpYv0W3fnqfLPM0WBfVRI+J8s96slVOKH3VSR11vRMt q7uHQaZ6d6OArw+KryKnJGnONP3IXMOlYgyJBCAKiYe9hdHFuekSVVhnvH7kk44o8CS1 38dA== 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 x22-v6si6462048pln.235.2018.06.14.19.11.41; Thu, 14 Jun 2018 19:11:55 -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 S965391AbeFOCKA (ORCPT + 99 others); Thu, 14 Jun 2018 22:10:00 -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 S965072AbeFOCJ7 (ORCPT ); Thu, 14 Jun 2018 22:09:59 -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:09:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,225,1526367600"; d="scan'208";a="49141578" Received: from skl.sh.intel.com ([10.239.161.125]) by orsmga007.jf.intel.com with ESMTP; 14 Jun 2018 19:09:56 -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 0/2] perf: Drop leaked kernel samples Date: Fri, 15 Jun 2018 18:03:21 +0800 Message-Id: <1529057003-2212-1-git-send-email-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On workloads that do a lot of kernel entry/exits we see kernel samples, even though :u is specified. This is due to skid existing. This might be a security issue because it can leak kernel addresses even though kernel sampling support is disabled. One patch "perf/core: Drop kernel samples even though :u is specified" was posted in last year but it was reverted because it introduced a regression issue that broke the rr-project. Now this patch set uses sysctl to control the dropping of leaked kernel samples. /sys/devices/cpu/perf_allow_sample_leakage: 0 - default, drop the leaked kernel samples. 1 - don't drop the leaked kernel samples. For rr it can write 1 to /sys/devices/cpu/perf_allow_sample_leakage to keep original system behavior. Jin Yao (2): perf/core: Use sysctl to turn on/off dropping leaked kernel samples perf Documentation: Introduce the sysctl perf_allow_sample_leakage kernel/events/core.c | 58 ++++++++++++++++++++++++++++++++ tools/perf/Documentation/perf-record.txt | 14 ++++++++ 2 files changed, 72 insertions(+) -- 2.7.4