[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <555617C8.1070309@plumgrid.com>
Date: Fri, 15 May 2015 08:59:04 -0700
From: Alexei Starovoitov <ast@...mgrid.com>
To: Wang Nan <wangnan0@...wei.com>
CC: lizefan@...wei.com, linux-kernel@...r.kernel.org, pi3orama@....com
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists