lkml.org 
[lkml]   [2022]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf: Fix sys_perf_event_open() race against self
On Mon, May 23, 2022 at 04:03:29PM +0530, Ravi Bangoria wrote:
> On 21-May-22 12:08 AM, Peter Zijlstra wrote:
> >
> > Norbert reported that it's possible to race sys_perf_event_open() such
> > that the looser ends up in another context from the group leader,
> > triggering many WARNs.
> >
> > The move_group case checks for races against itself, but the
> > !move_group case doesn't, seemingly relying on the previous
> > group_leader->ctx == ctx check. However, that check is racy due to not
> > holding any locks at that time.
> >
> > Therefore, re-check the result after acquiring locks and bailing
> > if they no longer match.
> >
> > Additionally, clarify the not_move_group case from the
> > move_group-vs-move_group race.
>
> Tested-by: Ravi Bangoria <ravi.bangoria@amd.com>
>
> Below is a quick test to reproduce the issue. It triggers WARN_ON()
> as normal user. No warnings with the patch.

Shouldn't this test be in tools/perf/tests/ or so?

If that hasn't happened yet, I mean.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

\
 
 \ /
  Last update: 2022-11-16 23:31    [W:0.069 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site