]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tracing/probes: Point the error offset correctly for eprobe argument error
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Mon, 25 May 2026 02:21:14 +0000 (11:21 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Sat, 30 May 2026 13:45:50 +0000 (22:45 +0900)
Fix to point the error offset correctly for eprobe argument error.
In the cleanup commit 1b8b0cd754cd ("tracing/probes: Move event parameter
fetching code to common parser"), due to incorrect backward compatibility
aimed at conforming to the test specifications, the error location was set
to 0 when a non-existent formal parameter was specified for Eprobe.
However, this should be corrected in both the test and the implementation
to point correct error position.

Link: https://lore.kernel.org/all/177967567399.209006.1451571244515632097.stgit@devnote2/
Fixes: 1b8b0cd754cd ("tracing/probes: Move event parameter fetching code to common parser")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_probe.c
tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc

index e0d3a0da26af51de0f87526db1fbc64910659ce5..44c22d4e7881888eda54de4a046912a04d42d61b 100644 (file)
@@ -962,8 +962,6 @@ static int parse_probe_vars(char *orig_arg, const struct fetch_type *t,
                        code->op = FETCH_OP_COMM;
                        return 0;
                }
-               /* backward compatibility */
-               ctx->offset = 0;
                goto inval;
        }
 
index 4f5e8c66515621009d0b549372d4813a2b404d67..2a680c086047fd97745a1a65a0ce14f2b062b3be 100644 (file)
@@ -20,7 +20,7 @@ check_error 'e:foo/^123456789012345678901234567890123456789012345678901234567890
 check_error 'e:foo/^bar.1 syscalls/sys_enter_openat'   # BAD_EVENT_NAME
 
 check_error 'e:foo/bar syscalls/sys_enter_openat arg=^dfd'     # BAD_FETCH_ARG
-check_error 'e:foo/bar syscalls/sys_enter_openat ^arg=$foo'    # BAD_ATTACH_ARG
+check_error 'e:foo/bar syscalls/sys_enter_openat arg=^$foo'    # BAD_ATTACH_ARG
 
 if grep -q '<attached-group>\.<attached-event>.*\[if <filter>\]' README; then
   check_error 'e:foo/bar syscalls/sys_enter_openat if ^'       # NO_EP_FILTER