lkml.org 
[lkml]   [2017]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf: protect group_leader from races that cause ctx
On Thu, Jan 05, 2017 at 03:14:29PM -0800, Kees Cook wrote:
> From: John Dias <joaodias@google.com>
>
> When moving a group_leader perf event from a software-context to
> a hardware-context, there's a race in checking and updating that
> context. The existing locking solution doesn't work; note that it tries
> to grab a lock inside the group_leader's context object, which you can
> only get at by going through a pointer that should be protected from these
> races. If two threads trigger this operation simultaneously, the refcount
> of 'perf_event_context' will fall to zero and the object may be freed.
>
> To avoid that problem, and to produce a simple solution, we can just
> use a lock per group_leader to protect all checks on the group_leader's
> context. The new lock is grabbed and released when no context locks are
> held.

This Changelog really stinks. I'll go try and reverse engineer the thing
:-(

\
 
 \ /
  Last update: 2017-01-06 10:36    [W:0.125 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site