summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2018-05-07 16:02:14 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2018-05-29 08:28:02 -0400
commitc94e45bc38ae484ee989e6e3b2496a52776da9e4 (patch)
tree95009b531888234a9134896c38716fcc68363653 /kernel/trace/trace.h
parentf39e239102837c603ebf3264eaa4a9385323c5c6 (diff)
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>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 507954b4e058..6bfc2467479c 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -1334,7 +1334,7 @@ event_trigger_unlock_commit(struct trace_event_file *file,
1334 trace_buffer_unlock_commit(file->tr, buffer, event, irq_flags, pc); 1334 trace_buffer_unlock_commit(file->tr, buffer, event, irq_flags, pc);
1335 1335
1336 if (tt) 1336 if (tt)
1337 event_triggers_post_call(file, tt, entry, event); 1337 event_triggers_post_call(file, tt);
1338} 1338}
1339 1339
1340/** 1340/**
@@ -1367,7 +1367,7 @@ event_trigger_unlock_commit_regs(struct trace_event_file *file,
1367 irq_flags, pc, regs); 1367 irq_flags, pc, regs);
1368 1368
1369 if (tt) 1369 if (tt)
1370 event_triggers_post_call(file, tt, entry, event); 1370 event_triggers_post_call(file, tt);
1371} 1371}
1372 1372
1373#define FILTER_PRED_INVALID ((unsigned short)-1) 1373#define FILTER_PRED_INVALID ((unsigned short)-1)