lkml.org 
[lkml]   [2015]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] perf: fix put_event() ctx leak
From
On Thu, Feb 26, 2015 at 8:43 PM, Leon Yu <chianglungyu@gmail.com> wrote:
>
> Commit a83fe28e2e45 ("perf: Fix put_event() ctx lock") changed lock logic in
> put_event() by replacing mutex_lock_nested() with perf_event_ctx_lock_nested(),
> but didn't fix subsequent mutex_unlock() with correct counterpart,
> perf_event_ctx_unlock(). ctx is thus leaked as a result of incremented
> refcount in perf_event_ctx_lock_nested().
>
> Signed-off-by: Leon Yu <chianglungyu@gmail.com>
> Fixes: a83fe28e2e45 ("perf: Fix put_event() ctx lock")
> ---
> kernel/events/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index f04daab..453ef61 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -3591,7 +3591,7 @@ static void put_event(struct perf_event *event)
> ctx = perf_event_ctx_lock_nested(event, SINGLE_DEPTH_NESTING);
> WARN_ON_ONCE(ctx->parent_ctx);
> perf_remove_from_context(event, true);
> - mutex_unlock(&ctx->mutex);
> + perf_event_ctx_unlock(event, ctx);
>
> _free_event(event);
> }

Gentle ping.

It has been two weeks since previous post, the issue remains un-fixed
and affects some more users [1].
It would be very appreciated if I can get some responses from related
maintainers since we're almost
half way to release.

[1] http://marc.info/?l=linux-kernel&m=142618052120848&w=2

-Leon


\
 
 \ /
  Last update: 2015-03-13 06:01    [W:0.040 / U:11.628 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site