summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Helsley <matthltc@us.ibm.com>2010-09-13 13:01:18 -0700
committerFrederic Weisbecker <fweisbec@gmail.com>2010-09-17 04:42:59 +0200
commit068e35eee9ef98eb4cab55181977e24995d273be (patch)
treef0ff9a1c1558218c6de222b58ea8f88a679151a0
parent89e45aac42d40426c97e6901811309bf49c4993f (diff)
downloadlinux-stable-068e35eee9ef98eb4cab55181977e24995d273be.tar.gz
linux-stable-068e35eee9ef98eb4cab55181977e24995d273be.tar.bz2
linux-stable-068e35eee9ef98eb4cab55181977e24995d273be.zip
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 <fweisbec@gmail.com> for doing the bulk of the work finding this bug. Reported-by: Robin Green <greenrd@greenrd.org> Signed-off-by: Matt Helsley <matthltc@us.ibm.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Prasad <prasad@linux.vnet.ibm.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Will Deacon <will.deacon@arm.com> Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Cc: 2.6.33-2.6.35 <stable@kernel.org> LKML-Reference: <f63454af09fb1915717251570423eb9ddd338340.1284407762.git.matthltc@us.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
-rw-r--r--kernel/hw_breakpoint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
index d71a987fd2bf..c7c2aed9e2dc 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);