]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tracing: tprobe-events: Fix to put tracepoint_user when disable the tprobe
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Thu, 6 Nov 2025 16:52:24 +0000 (01:52 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Thu, 6 Nov 2025 22:36:20 +0000 (07:36 +0900)
__unregister_trace_fprobe() checks tf->tuser to put it when removing
tprobe. However, disable_trace_fprobe() does not use it and only calls
unregister_fprobe(). Thus it forgets to disable tracepoint_user.

If the trace_fprobe has tuser, put it for unregistering the tracepoint
callbacks when disabling tprobe correctly.

Link: https://lore.kernel.org/all/176244794466.155515.3971904050506100243.stgit@devnote2/
Fixes: 2867495dea86 ("tracing: tprobe-events: Register tracepoint when enable tprobe event")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Tested-by: Beau Belgrave <beaub@linux.microsoft.com>
Reviewed-by: Beau Belgrave <beaub@linux.microsoft.com>
kernel/trace/trace_fprobe.c

index fd1b108ab639e70445ec763760842e28245b3db1..8001dbf16891915ddb7a9a1192e757e19190e88f 100644 (file)
@@ -1514,6 +1514,10 @@ static int disable_trace_fprobe(struct trace_event_call *call,
        if (!trace_probe_is_enabled(tp)) {
                list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list) {
                        unregister_fprobe(&tf->fp);
+                       if (tf->tuser) {
+                               tracepoint_user_put(tf->tuser);
+                               tf->tuser = NULL;
+                       }
                }
        }