Skip to content

Commit

Permalink
tracing: Have eprobes use filtering logic of trace events
Browse files Browse the repository at this point in the history
The eprobes open code the reserving of the event on the ring buffer for
ftrace instead of using the ftrace event wrappers, which means that it
doesn't get affected by the filters, breaking the filtering logic on user
space.

Link: https://lkml.kernel.org/r/[email protected]

Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
rostedt committed Dec 6, 2021
1 parent 6c536d7 commit 3e8b1a2
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions kernel/trace/trace_eprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,18 +489,12 @@ __eprobe_trace_func(struct eprobe_data *edata, void *rec)
if (trace_trigger_soft_disabled(edata->file))
return;

fbuffer.trace_ctx = tracing_gen_ctx();
fbuffer.trace_file = edata->file;

dsize = get_eprobe_size(&edata->ep->tp, rec);
fbuffer.regs = NULL;

fbuffer.event =
trace_event_buffer_lock_reserve(&fbuffer.buffer, edata->file,
call->event.type,
sizeof(*entry) + edata->ep->tp.size + dsize,
fbuffer.trace_ctx);
if (!fbuffer.event)

entry = trace_event_buffer_reserve(&fbuffer, edata->file,
sizeof(*entry) + edata->ep->tp.size + dsize);

if (!entry)
return;

entry = fbuffer.entry = ring_buffer_event_data(fbuffer.event);
Expand Down

0 comments on commit 3e8b1a2

Please sign in to comment.