From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755680Ab0IQCsi (ORCPT ); Thu, 16 Sep 2010 22:48:38 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:41806 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755567Ab0IQCsf (ORCPT ); Thu, 16 Sep 2010 22:48:35 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:x-mailer-version :in-reply-to:references; b=woeUrk13292z7aWZSXnFek54ODcHCJ1Auggomz1bNBG6knae64ETjzb66qqRW5VM8u J2Iq88jSQumkz7WFFPxpTcNe34wq7/hsYxYyajoMPEcpo7W2Nr6Oq/CIekDVDi1wCS7p g/ab2BvJBULq43dil3MwUS8dwAo3THUKd+zmk= From: Frederic Weisbecker To: Ingo Molnar Cc: LKML , Matt Helsley , Robin Green , Peter Zijlstra , Prasad , Arnaldo Carvalho de Melo , Steven Rostedt , Will Deacon , Mahesh Salgaonkar , "2.6.33-2.6.35" , Ingo Molnar , Frederic Weisbecker Subject: [PATCH 2/2] hw breakpoints: Fix pid namespace bug Date: Fri, 17 Sep 2010 04:48:22 +0200 Message-Id: <1284691702-32269-3-git-send-regression-fweisbec@gmail.com> X-Mailer: git-send-regression X-Mailer-version: 0.1, "The maintainer couldn't reproduce after one week full time debugging" special version. In-Reply-To: <1284691702-32269-1-git-send-regression-fweisbec@gmail.com> References: <1284691702-32269-1-git-send-regression-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matt Helsley 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); -- 1.6.2.3