]> asedeno.scripts.mit.edu Git - linux.git/commit
tracing: Do not reference event data in post call triggers
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 7 May 2018 20:02:14 +0000 (16:02 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 29 May 2018 12:28:02 +0000 (08:28 -0400)
commitc94e45bc38ae484ee989e6e3b2496a52776da9e4
tree95009b531888234a9134896c38716fcc68363653
parentf39e239102837c603ebf3264eaa4a9385323c5c6
tracing: Do not reference event data in post call triggers

Trace event triggers can be called before or after the event has been
committed. If it has been called after the commit, there's a possibility
that the event no longer exists. Currently, the two post callers is the
trigger to disable tracing (traceoff) and the one that will record a stack
dump (stacktrace). Neither of them reference the trace event entry record,
as that would lead to a race condition that could pass in corrupted data.

To prevent any other users of the post data triggers from using the trace
event record, pass in NULL to the post call trigger functions for the event
record, as they should never need to use them in the first place.

This does not fix any bug, but prevents bugs from happening by new post call
trigger users.

Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
include/linux/trace_events.h
kernel/trace/trace.h
kernel/trace/trace_events_trigger.c