Re: [PATCH] perf: extend total_ref_count usage to protect perf_trace_buf access

From: Peter Zijlstra
Date: Mon Mar 18 2019 - 11:15:39 EST


On Mon, Mar 18, 2019 at 11:02:50AM -0400, Steven Rostedt wrote:
> On Mon, 18 Mar 2019 16:17:45 +0530
> Prateek Sood <prsood@xxxxxxxxxxxxxx> wrote:
>
> > A potential race exists between access of perf_trace_buf[i] from
> > perf_trace_buf_alloc() and perf_trace_event_unreg(). This can
> > result in perf_trace_buf[i] being NULL during access from memset()
> > in perf_trace_buf_alloc().

Can you expound?