Messages in this thread | | | Date | Fri, 15 May 2015 08:59:04 -0700 | From | Alexei Starovoitov <> | Subject | Re: [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.
| |