Re: [PATCH] perf: protect group_leader from races that cause ctx

2017-01-10 Thread Kees Cook
On Tue, Jan 10, 2017 at 2:16 AM, Ingo Molnar wrote: > > * Kees Cook wrote: > >> > [...] >> > Reported-by: Kees Cook >> >> I was just relaying a fix. I noted the original reporter in the first >> patch, how they asked to be credited: >> >> Reported-by: Di Shen (@returnsme) of KeenLab (@keen_lab),

Re: [PATCH] perf: protect group_leader from races that cause ctx

2017-01-10 Thread Ingo Molnar
* Kees Cook wrote: > > [...] > > Reported-by: Kees Cook > > I was just relaying a fix. I noted the original reporter in the first > patch, how they asked to be credited: > > Reported-by: Di Shen (@returnsme) of KeenLab (@keen_lab), Tencent So while it's OK to not give an email address (unlik

Re: [PATCH] perf: protect group_leader from races that cause ctx

2017-01-10 Thread Peter Zijlstra
On Fri, Jan 06, 2017 at 12:39:17PM -0800, Kees Cook wrote: > > Reported-by: Kees Cook > > I was just relaying a fix. I noted the original reporter in the first > patch, how they asked to be credited: > > Reported-by: Di Shen (@returnsme) of KeenLab (@keen_lab), Tencent That's not a valid tag, c

Re: [PATCH] perf: protect group_leader from races that cause ctx

2017-01-09 Thread Kees Cook
On Sat, Jan 7, 2017 at 8:29 AM, John Dias wrote: >> John, are you able to test this solution? IIUC, you've got a reproducer >> handy? > > Yes, I tested against two reproducers. Both were fixed by this solution. Great! Thanks for testing this. > Thanks to Kees and Peter for your patience on this

Re: [PATCH] perf: protect group_leader from races that cause ctx

2017-01-07 Thread John Dias
> John, are you able to test this solution? IIUC, you've got a reproducer handy? Yes, I tested against two reproducers. Both were fixed by this solution. Thanks to Kees and Peter for your patience on this. John

Re: [PATCH] perf: protect group_leader from races that cause ctx

2017-01-06 Thread Kees Cook
On Fri, Jan 6, 2017 at 5:14 AM, Peter Zijlstra wrote: > On Fri, Jan 06, 2017 at 10:32:51AM +0100, Peter Zijlstra wrote: >> On Thu, Jan 05, 2017 at 03:14:29PM -0800, Kees Cook wrote: >> > From: John Dias >> > >> > When moving a group_leader perf event from a software-context to >> > a hardware-con

Re: [PATCH] perf: protect group_leader from races that cause ctx

2017-01-06 Thread Peter Zijlstra
On Fri, Jan 06, 2017 at 10:32:51AM +0100, Peter Zijlstra wrote: > On Thu, Jan 05, 2017 at 03:14:29PM -0800, Kees Cook wrote: > > From: John Dias > > > > When moving a group_leader perf event from a software-context to > > a hardware-context, there's a race in checking and updating that > > contex

Re: [PATCH] perf: protect group_leader from races that cause ctx

2017-01-06 Thread Peter Zijlstra
On Thu, Jan 05, 2017 at 03:14:29PM -0800, Kees Cook wrote: > From: John Dias > > 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

[PATCH] perf: protect group_leader from races that cause ctx

2017-01-05 Thread Kees Cook
From: John Dias 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