]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tracing/probes: Fix to show a parse error for bad type for $comm
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 23 Jan 2024 15:02:34 +0000 (00:02 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:25:05 +0000 (09:25 +0100)
commitd5889a68522c2d2da6ee75e75aa36e2997b6d4dd
treeea3c2ff334f219b160fc8fceb0403c94835dc07d
parentac9a1c3bcd458311b334ee15992f4ff2899b41de
tracing/probes: Fix to show a parse error for bad type for $comm

commit 8c427cc2fa73684ea140999e121b7b6c1c717632 upstream.

Fix to show a parse error for bad type (non-string) for $comm/$COMM and
immediate-string. With this fix, error_log file shows appropriate error
message as below.

 /sys/kernel/tracing # echo 'p vfs_read $comm:u32' >> kprobe_events
sh: write error: Invalid argument
 /sys/kernel/tracing # echo 'p vfs_read \"hoge":u32' >> kprobe_events
sh: write error: Invalid argument
 /sys/kernel/tracing # cat error_log

[   30.144183] trace_kprobe: error: $comm and immediate-string only accepts string type
  Command: p vfs_read $comm:u32
                            ^
[   62.618500] trace_kprobe: error: $comm and immediate-string only accepts string type
  Command: p vfs_read \"hoge":u32
                              ^
Link: https://lore.kernel.org/all/170602215411.215583.2238016352271091852.stgit@devnote2/
Fixes: 3dd1f7f24f8c ("tracing: probeevent: Fix to make the type of $comm string")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_probe.c
kernel/trace/trace_probe.h