]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tracing/probes: Remove WARN_ON_ONCE from parse_btf_arg
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Wed, 24 Jun 2026 23:34:46 +0000 (08:34 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 30 Jun 2026 14:58:19 +0000 (23:58 +0900)
Sashiko found that user can cause this WARN_ON_ONCE() easily
with adding a kprobe event based on a raw address with BTF
parameter.

Since this is not an unexpected condition, remove the
WARN_ON_ONCE().

Link: https://lore.kernel.org/all/178177265367.2059927.13789953014706792126.stgit@mhiramat.tok.corp.google.com/
Link: https://sashiko.dev/#/patchset/178165816303.269421.7302603996990753309.stgit%40devnote2
Reported-by: Sashiko <sashiko-bot@kernel.org>
Fixes: b576e09701c7 ("tracing/probes: Support function parameters if BTF is available")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
kernel/trace/trace_probe.c

index fd1caa1f97233cda072ac68b62af2e2d357251d4..98532c503d02834fd0857d966378cc0cb92b9342 100644 (file)
@@ -678,7 +678,7 @@ static int parse_btf_arg(char *varname,
        int i, is_ptr, ret;
        u32 tid;
 
-       if (WARN_ON_ONCE(!ctx->funcname && !(ctx->flags & TPARG_FL_TEVENT)))
+       if (!ctx->funcname && !(ctx->flags & TPARG_FL_TEVENT))
                return -EINVAL;
 
        is_ptr = split_next_field(varname, &field, ctx);