From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795603164; b=I6glzvCZMIOMibjYZobwtpqGPycLZhL1Y0mWGJSz7rzu3ONZLfwNyfDmQVJUa5iO1c/e 9YYxPv+kDrLUy4x3NtM7Mo60KaonVPTvAkCj6o4le6th7ItTzJEi8W/pLSE3aTQ1qS49B cmv36mq8wg5rE7uRxq2ljn7BwqsFI+4qXen8ZQwsiCcHJQJpDnMUikx7qtxzyVXeGLhmK Ga7iJeQYsm/K1dQnj5nFKnGtB18xh5OeSyPX0o+TOBt0L3I4UFALiyK9JDKJ7mBzvCV1G D+FCx1uC4W7y3fd657DaciwZUx+S8Q2Ve33VbGLyRSKUqDLecIr6WlOUxru7df4okXg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795603164; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=WnSEAKOu4p2jP+iNTHN7hC8VlGegEIRjoCtcXMLygkE=; b=U8hkv7MBvruLv1+hCJEiYtym0B8g+jVw3Q+bIW53v8eGmigrX0mnMcDffcmRY8yDswre x/Bsqu2ZTOIQfvJDqyVqtVZC1t91M5uRm3tAdK+2IG3FibTygEigMRahHXVbuy3Iu6RNA ntTh3CygWr8gIyGRILdnmrt7VTE6wrFLmL+vp0Si/rGLNwyAEtC+TUchz/AQ3vFUzcRpb DK/fxKr9rko0rL6yVi/9p+/3n8rsdiORYJo9YS4TaHwq0kRn16YK1yvb5/5bd9QItBMb7 3ZtkrpTEVca1W3455Tycw1HIHku3AJILq5GPA9nu8EdyMviLgdv/APTQ6wT05Cq4HMg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=CB9Sehbk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59487606A323 for ; Wed, 25 Nov 2026 10:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=CB9Sehbk Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AADD1F000C6; Wed, 25 Nov 2026 10:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795603164; bh=WnSEAKOu4p2jP+iNTHN7hC8VlGegEIRjoCtcXMLygkE=; h=Subject:To:Cc:From:Date; b=CB9SehbkKkWuYA8zLWPJ1UO644+0OhxSxpnCvUZWRBMst0TB+vAYf96fypA/3BIPZ Yw/lHz6la38PsPtQKghcN5Umh5zvwaYKNJIyBH1xmrEtSeRBmSju7cRsj3DxxC1dmf mgvz57hUhxBd1lhQEYPDB7UoJeUwMGRFkm0jbOE8= Subject: FAILED: patch "[PATCH] tracing/probes: Enable newly appended probe when target event" failed to apply to 6.6-stable tree To: mhiramat@kernel.org Cc: From: Date: Wed, 25 Nov 2026 11:29:10 +0100 Message-ID: <2026112510-womb-harsh-6516@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x 72d3a5cb0cd7335553549aaffecc683e3ecc0c43 # git commit -s git send-email --to '' --in-reply-to '2026112510-womb-harsh-6516@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 72d3a5cb0cd7335553549aaffecc683e3ecc0c43 Mon Sep 17 00:00:00 2001 From: "Masami Hiramatsu (Google)" Date: Fri, 13 Nov 2026 17:28:18 +0900 Subject: [PATCH] tracing/probes: Enable newly appended probe when target event is enabled Unlike kprobe events, fprobe and uprobe events only register their underlying probes when the trace event is enabled. When a new probe is appended to an existing multiprobe fprobe or uprobe event that is already enabled, the appended probe is linked into the event's probe list without being registered. As a result, the newly appended probe never fires until the event is disabled and re-enabled. Moreover, disabling an fprobe event calls unregister_fprobe() on the unregistered fprobe, and opening or closing a perf event on an enabled uprobe event dereferences a NULL tu->uprobe in uprobe_apply(). Register and enable the newly appended fprobe or uprobe immediately when the target event is already enabled. Link: https://lore.kernel.org/all/179455849798.403392.135678786198324285.stgit@devnote2/ Fixes: 41af3cf587f4 ("tracing/uprobe: Add multi-probe per uprobe event support") Fixes: 2db832ec9090 ("tracing: fprobe-events: Register fprobe-events only when it is enabled") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c index 77f2228d44ba..9ab0871a6461 100644 --- a/kernel/trace/trace_fprobe.c +++ b/kernel/trace/trace_fprobe.c @@ -933,7 +933,10 @@ static int append_trace_fprobe_event(struct trace_fprobe *tf, struct trace_fprob if (ret) return ret; - ret = trace_fprobe_verify_target(tf); + if (trace_probe_is_enabled(&tf->tp)) + ret = __register_trace_fprobe(tf); + else + ret = trace_fprobe_verify_target(tf); if (ret) trace_probe_unlink(&tf->tp); else @@ -1520,13 +1523,8 @@ static int disable_trace_fprobe(struct trace_event_call *call, trace_probe_clear_flag(tp, TP_FLAG_PROFILE); 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; - } - } + list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list) + __unregister_trace_fprobe(tf); } out: diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 146da04b93a8..14ac52aebe34 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c @@ -447,6 +447,28 @@ static bool trace_uprobe_has_same_uprobe(struct trace_uprobe *orig, return false; } +typedef bool (*filter_func_t)(struct uprobe_consumer *self, struct mm_struct *mm); + +#ifdef CONFIG_PERF_EVENTS +static bool uprobe_perf_filter(struct uprobe_consumer *uc, struct mm_struct *mm); +#else +#define uprobe_perf_filter NULL +#endif + +static int trace_uprobe_enable(struct trace_uprobe *tu, filter_func_t filter) +{ + struct inode *inode = d_real_inode(tu->path.dentry); + struct uprobe *uprobe; + + tu->consumer.filter = filter; + uprobe = uprobe_register(inode, tu->offset, tu->ref_ctr_offset, &tu->consumer); + if (IS_ERR(uprobe)) + return PTR_ERR(uprobe); + + tu->uprobe = uprobe; + return 0; +} + static int append_trace_uprobe(struct trace_uprobe *tu, struct trace_uprobe *to) { int ret; @@ -466,10 +488,22 @@ static int append_trace_uprobe(struct trace_uprobe *tu, struct trace_uprobe *to) /* Append to existing event */ ret = trace_probe_append(&tu->tp, &to->tp); - if (!ret) - dyn_event_add(&tu->devent, trace_probe_event_call(&tu->tp)); + if (ret) + return ret; - return ret; + if (trace_probe_is_enabled(&tu->tp)) { + ret = trace_uprobe_enable(tu, + trace_probe_test_flag(&tu->tp, TP_FLAG_PROFILE) ? + uprobe_perf_filter : NULL); + if (ret) { + trace_probe_unlink(&tu->tp); + return ret; + } + } + + dyn_event_add(&tu->devent, trace_probe_event_call(&tu->tp)); + + return 0; } /* @@ -1105,22 +1139,6 @@ print_uprobe_event(struct trace_iterator *iter, int flags, struct trace_event *e return trace_handle_return(s); } -typedef bool (*filter_func_t)(struct uprobe_consumer *self, struct mm_struct *mm); - -static int trace_uprobe_enable(struct trace_uprobe *tu, filter_func_t filter) -{ - struct inode *inode = d_real_inode(tu->path.dentry); - struct uprobe *uprobe; - - tu->consumer.filter = filter; - uprobe = uprobe_register(inode, tu->offset, tu->ref_ctr_offset, &tu->consumer); - if (IS_ERR(uprobe)) - return PTR_ERR(uprobe); - - tu->uprobe = uprobe; - return 0; -} - static void __probe_event_disable(struct trace_probe *tp) { struct trace_uprobe *tu;