diff options
author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2022-11-14 13:47:56 +0900 |
---|---|---|
committer | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2022-12-15 09:00:20 +0900 |
commit | d4505aa6afae17a20c2f3ccfbfb7a07881b7ae02 (patch) | |
tree | fe4de1b85fc786acf5b5d89bc253879bf5fde03f /kernel/trace/trace_probe.h | |
parent | b26a124cbfa80f42bfc4e63e1d5643ca98159d66 (diff) | |
download | linux-d4505aa6afae17a20c2f3ccfbfb7a07881b7ae02.tar.gz linux-d4505aa6afae17a20c2f3ccfbfb7a07881b7ae02.tar.bz2 linux-d4505aa6afae17a20c2f3ccfbfb7a07881b7ae02.zip |
tracing/probes: Reject symbol/symstr type for uprobe
Since uprobe's argument must contain the user-space data, that
should not be converted to kernel symbols. Reject if user
specifies these types on uprobe events. e.g.
/sys/kernel/debug/tracing # echo 'p /bin/sh:10 %ax:symbol' >> uprobe_events
sh: write error: Invalid argument
/sys/kernel/debug/tracing # echo 'p /bin/sh:10 %ax:symstr' >> uprobe_events
sh: write error: Invalid argument
/sys/kernel/debug/tracing # cat error_log
[ 1783.134883] trace_uprobe: error: Unknown type is specified
Command: p /bin/sh:10 %ax:symbol
^
[ 1792.201120] trace_uprobe: error: Unknown type is specified
Command: p /bin/sh:10 %ax:symstr
^
Link: https://lore.kernel.org/all/166679931679.1528100.15540755370726009882.stgit@devnote3/
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Diffstat (limited to 'kernel/trace/trace_probe.h')
-rw-r--r-- | kernel/trace/trace_probe.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h index 0838b74f403b..23acfd1c3812 100644 --- a/kernel/trace/trace_probe.h +++ b/kernel/trace/trace_probe.h @@ -358,7 +358,8 @@ int trace_probe_create(const char *raw_command, int (*createfn)(int, const char #define TPARG_FL_KERNEL BIT(1) #define TPARG_FL_FENTRY BIT(2) #define TPARG_FL_TPOINT BIT(3) -#define TPARG_FL_MASK GENMASK(3, 0) +#define TPARG_FL_USER BIT(4) +#define TPARG_FL_MASK GENMASK(4, 0) extern int traceprobe_parse_probe_arg(struct trace_probe *tp, int i, const char *argv, unsigned int flags); |