lkml.org 
[lkml]   [2015]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] bpf: fix a race between perf_event_fd and kprobe freeing
On 5/15/15 3:52 AM, Wang Nan wrote:
> According to Alexei Starovoitov (http://lkml.org/lkml/2015/5/15/29),
> there is racing between perf_event_fd and kprobe freeing:

...

> And he suggest to call perf_event_free_bpf_prog() from __free_event()
> instead of free_event_rcu() will fix the race,
...

> @@ -3564,6 +3563,8 @@ static void __free_event(struct perf_event *event)
> module_put(event->pmu->module);
> }
>
> + perf_event_free_bpf_prog(event);
> +
> call_rcu(&event->rcu_head, free_event_rcu);
> }

I don't think that's the right place. It needs to be before destroy().
I will send a patch soon.



\
 
 \ /
  Last update: 2015-05-15 19:01    [W:0.039 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site