Re: [PATCH kernel] tracepoint: Fix race between tracing and removing tracepoint

2021-02-02 Thread Peter Zijlstra
On Tue, Feb 02, 2021 at 06:23:26PM +1100, Alexey Kardashevskiy wrote: > When executing a tracepoint, the tracepoint's func is dereferenced twice - > in __DO_TRACE() (where the returned pointer is checked) and later on in > __traceiter_##_name where the returned pointer is dereferenced without > che

[PATCH kernel] tracepoint: Fix race between tracing and removing tracepoint

2021-02-01 Thread Alexey Kardashevskiy
When executing a tracepoint, the tracepoint's func is dereferenced twice - in __DO_TRACE() (where the returned pointer is checked) and later on in __traceiter_##_name where the returned pointer is dereferenced without checking which leads to races against tracepoint_removal_sync() and crashes. Thi