• Steven Rostedt (Red Hat)'s avatar
    tracing: Fix race between deleting buffer and setting events · 2a6c24af
    Steven Rostedt (Red Hat) authored
    While analyzing the code, I discovered that there's a potential race between
    deleting a trace instance and setting events. There are a few races that can
    occur if events are being traced as the buffer is being deleted. Mostly the
    problem comes with freeing the descriptor used by the trace event callback.
    To prevent problems like this, the events are disabled before the buffer is
    deleted. The problem with the current solution is that the event_mutex is let
    go between disabling the events and freeing the files, which means that the events
    could be enabled again while the freeing takes place.
    
    Cc: stable@vger.kernel.org # 3.10
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    2a6c24af
trace_events.c 61.7 KB