Skip to content

Commit b6ea7bc

Browse files
committed
Merge tag 'trace-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fix from Steven Rostedt: "This fixes kprobes/uprobes dynamic processing of strings, where it processes the args but does not update the remaining length of the buffer that the string arguments will be placed in. It constantly passes in the total size of buffer used instead of passing in the remaining size of the buffer used. This could cause issues if the strings are larger than the max size of an event which could cause the strings to be written beyond what was reserved on the buffer" * tag 'trace-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: probeevent: Correctly update remaining space in dynamic area
2 parents 1f947a7 + f667587 commit b6ea7bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/trace/trace_probe_tmpl.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,12 @@ store_trace_args(void *data, struct trace_probe *tp, struct pt_regs *regs,
180180
if (unlikely(arg->dynamic))
181181
*dl = make_data_loc(maxlen, dyndata - base);
182182
ret = process_fetch_insn(arg->code, regs, dl, base);
183-
if (unlikely(ret < 0 && arg->dynamic))
183+
if (unlikely(ret < 0 && arg->dynamic)) {
184184
*dl = make_data_loc(0, dyndata - base);
185-
else
185+
} else {
186186
dyndata += ret;
187+
maxlen -= ret;
188+
}
187189
}
188190
}
189191

0 commit comments

Comments
 (0)