From: Alison Schofield <alison.schofield@intel.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] tracing: Fix trace_check_vprintf() when tp_printk is used
Date: Thu, 3 Oct 2024 12:25:57 -0700 [thread overview]
Message-ID: <Zv7vxSu9gAhuA0ws@aschofie-mobl2.lan> (raw)
In-Reply-To: <20241003104925.4e1b1fd9@gandalf.local.home>
On Thu, Oct 03, 2024 at 10:49:25AM -0400, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
>
> When the tp_printk kernel command line is used, the trace events go
> directly to printk(). It is still checked via the trace_check_vprintf()
> function to make sure the pointers of the trace event are legit.
>
> The addition of reading buffers from previous boots required adding a
> delta between the addresses of the previous boot and the current boot so
> that the pointers in the old buffer can still be used. But this required
> adding a trace_array pointer to acquire the delta offsets.
>
> The tp_printk code does not provide a trace_array (tr) pointer, so when
> the offsets were examined, a NULL pointer dereference happened and the
> kernel crashed.
>
> If the trace_array does not exist, just default the delta offsets to zero,
> as that also means the trace event is not being read from a previous boot.
>
> Link: https://lore.kernel.org/all/Zv3z5UsG_jsO9_Tb@aschofie-mobl2.lan/
>
Thanks Steve!
Tested-by: Alison Schofield <alison.schofield@intel.com>
> Reported-by: Alison Schofield <alison.schofield@intel.com>
> Fixes: 07714b4bb3f98 ("tracing: Handle old buffer mappings for event strings and functions")
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> kernel/trace/trace.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
>
snip
prev parent reply other threads:[~2024-10-03 19:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-03 14:49 [PATCH] tracing: Fix trace_check_vprintf() when tp_printk is used Steven Rostedt
2024-10-03 19:25 ` Alison Schofield [this message]
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=Zv7vxSu9gAhuA0ws@aschofie-mobl2.lan \
--to=alison.schofield@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.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