public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
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, rostedt@goodmis.org,
	tglx@linutronix.de, prasad@linux.vnet.ibm.com,
	greenrd@greenrd.org, mingo@elte.hu
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:perf/core] hw breakpoints: Fix pid namespace bug
Date: Wed, 15 Sep 2010 13:41:53 +0200	[thread overview]
Message-ID: <20100915114150.GA5621@nowhere> (raw)
In-Reply-To: <tip-d958077d007d98125766d11e82da2fd6497b91d6@git.kernel.org>

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


  reply	other threads:[~2010-09-15 11:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1284408080-2135-1-git-send-email-matthltc@us.ibm.com>
2010-09-13 20:01 ` [PATCH 1/3] hw breakpoints: Fix pid namespace bug Matt Helsley
2010-09-13 20:01   ` [PATCH 2/3] perf events: Split out task search into helper Matt Helsley
2010-09-15 10:03     ` [tip:perf/core] " tip-bot for Matt Helsley
2010-09-13 20:01   ` [PATCH 3/3] perf events: Cleanup pid passing Matt Helsley
2010-09-15  8:18     ` Peter Zijlstra
2010-09-15 10:03     ` [tip:perf/core] perf events: Clean up " tip-bot for Matt Helsley
2010-09-22 12:22       ` Peter Zijlstra
2010-09-15 10:03   ` [tip:perf/core] hw breakpoints: Fix pid namespace bug tip-bot for Matt Helsley
2010-09-15 11:41     ` Frederic Weisbecker [this message]
2010-09-15 11:45       ` Ingo Molnar
2010-09-17  8:28   ` [tip:perf/urgent] " tip-bot for Matt Helsley
2010-09-13 20:08 ` [PATCH 0/3] perf_events and hw_breakpoints fix and cleanup Frederic Weisbecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100915114150.GA5621@nowhere \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=greenrd@greenrd.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=matthltc@us.ibm.com \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=prasad@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox