From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753279AbbHaOLo (ORCPT ); Mon, 31 Aug 2015 10:11:44 -0400 Received: from mga11.intel.com ([192.55.52.93]:19193 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752942AbbHaOLn (ORCPT ); Mon, 31 Aug 2015 10:11:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,441,1437462000"; d="scan'208";a="552228467" From: Alexander Shishkin To: Peter Zijlstra , Ingo Molnar Cc: linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, Arnaldo Carvalho de Melo , Alexander Shishkin Subject: [PATCH v1 0/2] perf/x86/intel: Work around BTS leaking kernel addresses Date: Mon, 31 Aug 2015 17:09:26 +0300 Message-Id: <1441030168-6853-1-git-send-email-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter and Ingo, This is a respin to address Ingo's comments: I replaced the awkward address comparison against PAGE_OFFSET with a kernel_ip() in the first patch and amended the wording in the second. The original story follows. Due to imprecise IP sampling, BTS may (and often does) leak kernel addresses when kernel tracing is not even enabled, which results in mostly syscall entry points and page_fault handler addresses being exposed. This might be a security concern for the address randomization, and it also makes life harder for gdb that makes use of bts samples. This patchset works around the old (DS) driver and disables the new (intel_bts) for the unprivileged users on systems where perf paranoia level prohibits kernel tracing. Not sure if these should be treated as bugfixes. Alexander Shishkin (2): perf/x86/intel/ds: Work around BTS leaking kernel addresses perf/x86/intel/bts: Disallow use by unprivileged users on paranoid systems arch/x86/kernel/cpu/perf_event_intel_bts.c | 13 ++++++++++ arch/x86/kernel/cpu/perf_event_intel_ds.c | 40 +++++++++++++++++++++++++----- 2 files changed, 47 insertions(+), 6 deletions(-) -- 2.5.0