[lkml]   [2010]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[31/80] hw breakpoints: Fix pid namespace bug
2.6.35-stable review patch.  If anyone has any objections, please let us know.


From: Matt Helsley <>

commit 068e35eee9ef98eb4cab55181977e24995d273be upstream.

Hardware breakpoints can't be registered within pid namespaces
because tsk->pid is passed rather than the pid in the current

(See )

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 <>
LKML-Reference: <>
Signed-off-by: Ingo Molnar <>
Signed-off-by: Frederic Weisbecker <>
Signed-off-by: Greg Kroah-Hartman <>

kernel/hw_breakpoint.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/kernel/hw_breakpoint.c
+++ b/kernel/hw_breakpoint.c
@@ -417,7 +417,8 @@ register_user_hw_breakpoint(struct perf_
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);

 \ /
  Last update: 2010-09-27 20:09    [W:0.318 / U:11.044 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site