lkml.org 
[lkml]   [2022]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] tracing: Fix race where eprobes can be called before the event
On Fri, 18 Nov 2022 21:18:09 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:

> This looks good to me.
>
> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>
> BTW, would other trigger callbacks also need to add similar checks?

I just checked, and yes, I think that histograms (the only other trigger
that has EVENT_CMD_FL_NEEDS_REC set) has the same issue, and requires:

diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 087c19548049..1c82478e8dff 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -5143,6 +5143,9 @@ static void event_hist_trigger(struct event_trigger_data *data,
void *key = NULL;
unsigned int i;

+ if (unlikely(!rbe))
+ return;
+
memset(compound_key, 0, hist_data->key_size);

for_each_hist_key_field(i, hist_data) {

I'll add that next.

-- Steve

\
 
 \ /
  Last update: 2022-11-23 22:03    [W:0.028 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site