All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: rostedt@goodmis.org,beaub@linux.microsoft.com
Cc: <stable@vger.kernel.org>
Subject: FAILED: patch "[PATCH] tracing: Do not allow user events to add a system name" failed to apply to 6.1-stable tree
Date: Wed, 02 Dec 2026 14:57:51 +0100	[thread overview]
Message-ID: <2026120251-derby-ogle-0d28@gregkh> (raw)


The patch below does not apply to the 6.1-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 <stable@vger.kernel.org>.

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.1.y
git checkout FETCH_HEAD
git cherry-pick -x 761a77e09577bc7e5fdaff1d11bbff3486a87bf9
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026120251-derby-ogle-0d28@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'

Possible dependencies:



thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 761a77e09577bc7e5fdaff1d11bbff3486a87bf9 Mon Sep 17 00:00:00 2001
From: Steven Rostedt <rostedt@goodmis.org>
Date: Wed, 18 Nov 2026 12:25:20 -0500
Subject: [PATCH] tracing: Do not allow user events to add a system name

User events currently do not support the addition of a system name, but
the parsing does not check to see if one is specified.

A kprobe can add its own system name with the following command:

 ~# echo 'p:mysystem/kprobe_event schedule a=%ax' >> dynamic_events
 ~# ls events/mysystem
 enable  filter  kprobe_event

But if one tries to do the same with user events:

 ~# echo 'u:user_events/test u32 a' >> dynamic_events
 ~# ls events/user_events
 ls: reading directory 'events/user_events/': Invalid argument
 enable  filter

It corrupts the file system as the event added had a '/' in the name.

Until user events support specifying system names, just return -EINVAL to
prevent the corrupted file system from happening:

 ~# echo 'u:user_events/test u32 a' >> dynamic_events
 -bash: echo: write error: Invalid argument

Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261118122520.4a689710@gandalf.local.home
Acked-by: Beau Belgrave <beaub@linux.microsoft.com>
Fixes: 7f5a08c79df35 ("user_events: Add minimal support for trace_event into ftrace")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c
index ea6a20a30cf5..e29e1c772aa7 100644
--- a/kernel/trace/trace_events_user.c
+++ b/kernel/trace/trace_events_user.c
@@ -1040,6 +1040,9 @@ static int user_event_parse_cmd(struct user_event_group *group,
 	if (flags)
 		*flags++ = '\0';
 
+	if (strstr(name, "/") != NULL)
+		return -EINVAL;
+
 	return user_event_parse(group, name, args, flags, newuser, reg_flags);
 }
 


                 reply	other threads:[~2026-12-02 14:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026120251-derby-ogle-0d28@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=beaub@linux.microsoft.com \
    --cc=rostedt@goodmis.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.