From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753031Ab0IQI3V (ORCPT ); Fri, 17 Sep 2010 04:29:21 -0400 Received: from hera.kernel.org ([140.211.167.34]:59344 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752266Ab0IQI3S (ORCPT ); Fri, 17 Sep 2010 04:29:18 -0400 Date: Fri, 17 Sep 2010 08:28:20 GMT From: tip-bot for Matt Helsley Cc: linux-kernel@vger.kernel.org, acme@redhat.com, hpa@zytor.com, mingo@redhat.com, will.deacon@arm.com, a.p.zijlstra@chello.nl, matthltc@us.ibm.com, mahesh@linux.vnet.ibm.com, fweisbec@gmail.com, rostedt@goodmis.org, stable@kernel.org, tglx@linutronix.de, mingo@elte.hu, greenrd@greenrd.org, prasad@linux.vnet.ibm.com Reply-To: mingo@redhat.com, hpa@zytor.com, acme@redhat.com, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, will.deacon@arm.com, matthltc@us.ibm.com, mahesh@linux.vnet.ibm.com, fweisbec@gmail.com, rostedt@goodmis.org, stable@kernel.org, tglx@linutronix.de, prasad@linux.vnet.ibm.com, greenrd@greenrd.org, mingo@elte.hu In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] hw breakpoints: Fix pid namespace bug Message-ID: Git-Commit-ID: 068e35eee9ef98eb4cab55181977e24995d273be X-Mailer: tip-git-log-daemon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (hera.kernel.org [127.0.0.1]); Fri, 17 Sep 2010 08:28:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 068e35eee9ef98eb4cab55181977e24995d273be Gitweb: http://git.kernel.org/tip/068e35eee9ef98eb4cab55181977e24995d273be Author: Matt Helsley AuthorDate: Mon, 13 Sep 2010 13:01:18 -0700 Committer: Frederic Weisbecker CommitDate: Fri, 17 Sep 2010 04:42:59 +0200 hw breakpoints: Fix pid namespace bug Hardware breakpoints can't be registered within pid namespaces because tsk->pid is passed rather than the pid in the current namespace. (See https://bugzilla.kernel.org/show_bug.cgi?id=17281 ) This is a quick fix demonstrating the problem but is not the best method of solving the problem since passing pids internally is not the best way to avoid pid namespace bugs. Subsequent patches will show a better solution. Much thanks to Frederic Weisbecker for doing the bulk of the work finding this bug. Reported-by: Robin Green Signed-off-by: Matt Helsley Signed-off-by: Peter Zijlstra Cc: Prasad Cc: Arnaldo Carvalho de Melo Cc: Steven Rostedt Cc: Will Deacon Cc: Mahesh Salgaonkar Cc: 2.6.33-2.6.35 LKML-Reference: Signed-off-by: Ingo Molnar Signed-off-by: Frederic Weisbecker --- kernel/hw_breakpoint.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c index d71a987..c7c2aed 100644 --- a/kernel/hw_breakpoint.c +++ b/kernel/hw_breakpoint.c @@ -433,7 +433,8 @@ register_user_hw_breakpoint(struct perf_event_attr *attr, perf_overflow_handler_t triggered, struct task_struct *tsk) { - return perf_event_create_kernel_counter(attr, -1, tsk->pid, triggered); + return perf_event_create_kernel_counter(attr, -1, task_pid_vnr(tsk), + triggered); } EXPORT_SYMBOL_GPL(register_user_hw_breakpoint);