summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-02-13 19:28:17 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2019-02-13 19:28:17 +0100
commitb6ea7bcf77831ee5741e903738a19c94715b15e9 (patch)
treeda76ee68adaec7b56c3b7108c6d16a32d03ac2fb /kernel
parentMerge branch 'akpm' (patches from Andrew) (diff)
parenttracing: probeevent: Correctly update remaining space in dynamic area (diff)
downloadlinux-b6ea7bcf77831ee5741e903738a19c94715b15e9.tar.xz
linux-b6ea7bcf77831ee5741e903738a19c94715b15e9.zip
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
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_probe_tmpl.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/trace/trace_probe_tmpl.h b/kernel/trace/trace_probe_tmpl.h
index 5c56afc17cf8..4737bb8c07a3 100644
--- a/kernel/trace/trace_probe_tmpl.h
+++ b/kernel/trace/trace_probe_tmpl.h
@@ -180,10 +180,12 @@ store_trace_args(void *data, struct trace_probe *tp, struct pt_regs *regs,
if (unlikely(arg->dynamic))
*dl = make_data_loc(maxlen, dyndata - base);
ret = process_fetch_insn(arg->code, regs, dl, base);
- if (unlikely(ret < 0 && arg->dynamic))
+ if (unlikely(ret < 0 && arg->dynamic)) {
*dl = make_data_loc(0, dyndata - base);
- else
+ } else {
dyndata += ret;
+ maxlen -= ret;
+ }
}
}