From: Lee Jones <lee@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Tom Zanussi <tom.zanussi@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 2/2] tracing/synthetic: Bound dynamic string copy to reserved length
Date: Wed, 2 Dec 2026 08:49:56 +0000 [thread overview]
Message-ID: <20261202084956.GP90630@joneslee-mac.roam.internal> (raw)
In-Reply-To: <20261201173925.1bda8445@gandalf.local.home>
On Tue, 01 Dec 2026, Steven Rostedt wrote:
> On Tue, 1 Dec 2026 14:29:07 +0000
> Lee Jones <lee@kernel.org> wrote:
>
> > static unsigned int trace_string(struct synth_trace_event *entry,
> > struct synth_event *event,
> > char *str_val,
> > bool is_dynamic,
> > unsigned int data_size,
> > + u16 max_len,
> > unsigned int *n_u64)
> > {
> > unsigned int len = 0;
> > @@ -442,14 +453,13 @@ static unsigned int trace_string(struct synth_trace_event *entry,
> >
> > data->as_dynamic.offset = struct_size(entry, fields, event->n_u64) + data_size;
> >
> > - ret = fetch_store_strlen((unsigned long)str_val);
> > - if (ret <= 0) {
> > + if (!max_len) {
>
> Why not just make this into:
>
> if (!is_dynamic || !max_len) {
Thanks Steve.
I agree with your review comments and will follow-up shortly.
--
Lee Jones
prev parent reply other threads:[~2026-12-02 8:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 14:29 [PATCH 0/2] tracing: Harden synthetic event string validation and copying Lee Jones
2026-12-01 14:29 ` [PATCH 1/2] tracing/histograms: Reject non-string fields for synthetic string fields Lee Jones
2026-12-01 14:29 ` [PATCH 2/2] tracing/synthetic: Bound dynamic string copy to reserved length Lee Jones
2026-12-01 22:39 ` Steven Rostedt
2026-12-02 8:49 ` Lee Jones [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=20261202084956.GP90630@joneslee-mac.roam.internal \
--to=lee@kernel.org \
--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 \
--cc=stable@vger.kernel.org \
--cc=tom.zanussi@linux.intel.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®