From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>,
Andrea Parri <parri.andrea@gmail.com>,
Jeff Barnes <jeffbarnes@linux.microsoft.com>,
Vincent Donnefort <vdonnefort@google.com>,
Yifan Feng <evanfengff@gmail.com>
Subject: [for-linus][PATCH 0/5] tracing: Fixes for v7.4
Date: Fri, 27 Nov 2026 13:42:03 -0500 [thread overview]
Message-ID: <20261127184203.439481361@kernel.org> (raw)
tracing fixes for v7.4:
- Fix user events on fork allocation failure
User events are created by user tasks to be able to be traced within
the kernel tracing facility. On fork, the duplication of user events
can fail. If this happens the state of the event becomes stale,
miss updates and produce undefined results.
As user events are part of the set up of the program that uses them,
fail a fork if the user event allocation fails for the new child.
This only affects programs that set up user events for themselves.
- Fix a remote event alignemnt offset output
The trace events for remote buffers does not take into account alignment
constraints, and produces incorrect field offsets that cause failure in
parsing the events from user space.
- Fix lost recursion records in recording ftrace functions that recurse
There's a race in the logic that records ftrace functions that recurse
where it checks if the last function that recursed is the same as the new
one and if it is, it ignores the recursion. But the recording of that last
function is done before the function is saved. If the saving fails due to
a race, then if the same function is recursed again, it will be ignored as
the code thinks it was recorded last time (but it wasn't).
- Reject '!!' at the beginning of input to set_ftrace_filter
To remove a single function from the set_ftrace_filter file, the user
echos "!func_name" into set_ftrace_filter and that function is removed
from the list. The issue is that the parsing logic sees the '!', records
it, removes it from the string and then continues the parsing with a "not"
variable set. The later logic of the "not" code checks if the first
character is a '!', and if it is, it triggers a WARN_ON() as it thinks the
logic was broken.
If the user echos in "!!func_name", the first '!' is removed and the not
variable set, and the second '!' is processed making the code think there
was a bug in the logic and triggers a WARN_ON().
Simply have the code first check for "!!" at the start and return -EINVAL
if that is found.
- Use atomic bitops and READ_ONCE() when processing flags variable
KSCAN reported a data race on the trace_event flags variable.
It is accessed in lockless mode during tracing and currently updated with
simple "|" or "&" logic. This causes a read-modify-write race.
Update the accesses to use bitops and READ_ONCE() to remove this race
condition.
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace/fixes
Head SHA1: 86020484c0cf36a72ab998274d051f9a14ff4f40
Andrea Parri (1):
ftrace: Fix lost recursion records in ftrace_record_recursion()
Jeff Barnes (1):
tracing/user_events: Fail fork when event state duplication fails
Masami Hiramatsu (Google) (1):
tracing/filters: Use atomic bitops and READ_ONCE() for trace_event_file::flags
Vincent Donnefort (1):
tracing/remotes: Align field offset in remote_event_format_show()
Yifan Feng (1):
ftrace: Reject "!!" in front of a set_ftrace_filter command
----
include/linux/trace_events.h | 2 +-
include/linux/user_events.h | 16 +++++++---------
kernel/fork.c | 8 ++++++--
kernel/trace/ftrace.c | 7 +++++++
kernel/trace/trace.c | 7 ++++---
kernel/trace/trace.h | 18 ++++++++++--------
kernel/trace/trace_events.c | 2 +-
kernel/trace/trace_events_filter.c | 12 ++----------
kernel/trace/trace_events_trigger.c | 5 +++--
kernel/trace/trace_events_user.c | 8 +++++---
kernel/trace/trace_recursion_record.c | 17 +++++++++--------
kernel/trace/trace_remote.c | 1 +
12 files changed, 56 insertions(+), 47 deletions(-)
next reply other threads:[~2026-11-27 18:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 18:42 Steven Rostedt [this message]
2026-11-27 18:42 ` [for-linus][PATCH 1/5] tracing/user_events: Fail fork when event state duplication fails Steven Rostedt
2026-11-27 18:42 ` [for-linus][PATCH 2/5] tracing/remotes: Align field offset in remote_event_format_show() Steven Rostedt
2026-11-27 18:42 ` [for-linus][PATCH 3/5] ftrace: Fix lost recursion records in ftrace_record_recursion() Steven Rostedt
2026-11-27 18:42 ` [for-linus][PATCH 4/5] ftrace: Reject "!!" in front of a set_ftrace_filter command Steven Rostedt
2026-11-27 18:42 ` [for-linus][PATCH 5/5] tracing/filters: Use atomic bitops and READ_ONCE() for trace_event_file::flags Steven Rostedt
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=20261127184203.439481361@kernel.org \
--to=rostedt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=evanfengff@gmail.com \
--cc=jeffbarnes@linux.microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=parri.andrea@gmail.com \
--cc=vdonnefort@google.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®