lkml.org 
[lkml]   [2010]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [tip:perf/core] hw breakpoints: Fix pid namespace bug
On Wed, Sep 15, 2010 at 10:03:06AM +0000, tip-bot for Matt Helsley wrote:
> Commit-ID: d958077d007d98125766d11e82da2fd6497b91d6
> Gitweb: http://git.kernel.org/tip/d958077d007d98125766d11e82da2fd6497b91d6
> Author: Matt Helsley <matthltc@us.ibm.com>
> AuthorDate: Mon, 13 Sep 2010 13:01:18 -0700
> Committer: Ingo Molnar <mingo@elte.hu>
> CommitDate: Wed, 15 Sep 2010 10:43: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 <fweisbec@gmail.com> for doing the
> bulk of the work finding this bug.
>
> Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Robin Green <greenrd@greenrd.org>
> 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>
> LKML-Reference: <f63454af09fb1915717251570423eb9ddd338340.1284407762.git.matthltc@us.ibm.com>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---


Aiie, you have been too fast too apply that on -tip, especially it should
go to perf/urgent with some stable backport tags. And I need to test them as
he said that was only compile tested.

Lemme just check it really fixes the issue and I'll package his
three patches in according pull requests.

Thanks.



> 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 3b2aaff..6122f02 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);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html



\
 
 \ /
  Last update: 2010-09-15 13:45    [W:0.081 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site