From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org, linux-trace-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>
Subject: [PATCH 0/2] tracing: Fix how the tracer options file ups the trace_array ref count
Date: Wed, 02 Sep 2026 17:26:09 -0400 [thread overview]
Message-ID: <20260902212609.542937225@kernel.org> (raw)
Sashiko reported that the tracer option files pass a descriptor to
the file system operations that points to the trace_array it is apart
of as well as information on the tracer option. It uses the trace_array
to up its reference counter so that it can not be deleted when the option
is open. The issue is that this descriptor sent to the open call itself
can be removed by the removal of the instance the trace_array represents.
There's nothing protecting it for going away and dereferencing it after
it has been freed.
Another issue is that the tracer options are an array on an array for
each tracer in the trace_array descriptor. The first patch converts
that to a single array. This is need for the second patch.
The second patch changes the open function to search all the existing
trace_arrays under lock and compare their topts array with the topt
passed to the open function. If the topt is within the range of
a trace_array topts array then that trace_array is considered a match
and its reference is updated.
Steven Rostedt (2):
tracing: Use a single array to represent tracer options files
tracing: Take trace_array reference when opening a tracer options file
----
kernel/trace/trace.c | 81 +++++++++++++++++++++++++++++++++-------------------
kernel/trace/trace.h | 21 ++++++--------
2 files changed, 60 insertions(+), 42 deletions(-)
next reply other threads:[~2026-09-02 21:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 21:26 Steven Rostedt [this message]
2026-09-02 21:26 ` [PATCH 1/2] tracing: Use a single array to represent tracer options files Steven Rostedt
2026-09-02 21:26 ` [PATCH 2/2] tracing: Take trace_array reference when opening a tracer options file 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=20260902212609.542937225@kernel.org \
--to=rostedt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox