aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-07 09:55:56 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-07 09:55:56 -0800
commitbdfa15f1a357bb90ab715e326e86cc546b282f49 (patch)
tree9c72fafb5854c50d0d88896f0d2433d15a994729 /kernel
parentMerge tag 'xfs-5.1-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux (diff)
parenttracing/kprobes: Use probe_kernel_read instead of probe_mem_read (diff)
downloadlinux-dev-bdfa15f1a357bb90ab715e326e86cc546b282f49.tar.xz
linux-dev-bdfa15f1a357bb90ab715e326e86cc546b282f49.zip
Merge tag 'trace-v5.0-pre' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fix/cleanup from Steven Rostedt: "This is a "pre-pull". It's only one small fix and one small clean up. I'm testing a few small patches for my real pull request which will come at a later time. The second patch depends on your tree anyway so I included it along with the urgent fix. A small fix Pavel sent me back in august was accidentally lost due to it being placed with some other patches that failed some tests, and was rebased out of my local tree. Which was a regression that caused event filters not to handle negative numbers. The clean up is from Masami that realized that the code in kprobes that calls probe_mem_read() wrapper, which is to be used in code used by both kprobes and uprobes, was only in code for kprobes. It should not use the wrapper there, but instead call probe_kernel_read() directly" * tag 'trace-v5.0-pre' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/kprobes: Use probe_kernel_read instead of probe_mem_read tracing: Fix event filters and triggers to handle negative numbers
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_events_filter.c5
-rw-r--r--kernel/trace/trace_kprobe.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 27821480105e..217ef481fbbb 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1301,7 +1301,7 @@ static int parse_pred(const char *str, void *data,
/* go past the last quote */
i++;
- } else if (isdigit(str[i])) {
+ } else if (isdigit(str[i]) || str[i] == '-') {
/* Make sure the field is not a string */
if (is_string_field(field)) {
@@ -1314,6 +1314,9 @@ static int parse_pred(const char *str, void *data,
goto err_free;
}
+ if (str[i] == '-')
+ i++;
+
/* We allow 0xDEADBEEF */
while (isalnum(str[i]))
i++;
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 9eaf07f99212..99592c27465e 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -865,7 +865,7 @@ fetch_store_strlen(unsigned long addr)
u8 c;
do {
- ret = probe_mem_read(&c, (u8 *)addr + len, 1);
+ ret = probe_kernel_read(&c, (u8 *)addr + len, 1);
len++;
} while (c && ret == 0 && len < MAX_STRING_SIZE);