From: Steven Rostedt <rostedt@goodmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: sashiko-bot@kernel.org, sashiko-reviews@lists.linux.dev,
"Linux Trace Kernel" <linux-trace-kernel@vger.kernel.org>
Subject: Re: [PATCH v7] tracing/probes: Zero out faulted dereferenced fields
Date: Tue, 24 Nov 2026 09:40:19 -0500 [thread overview]
Message-ID: <20261124094019.75f52b60@gandalf.local.home> (raw)
In-Reply-To: <undine-1795529710371793698-f2bd67810f91497f@undined.local>
On Tue, 24 Nov 2026 23:15:10 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
> > > [Severity: Medium]
> > > Should do_probe_mem_read() and do_probe_mem_read_user() check for a NULL
> > > src before calling probe_mem_read() and probe_mem_read_user()?
> >
> > No, but I guess I should add that as we probably shouldn't be dereferencing
> > zero when something fails.
>
> Maybe we should make it rejecting dereference if IS_ERR_OR_NULL(ptr).
Do any of these things return ERR? When one of the functions return an
error, the val (or current pointer) gets set to zero. Then that zero
continues to propagate.
The original problem was that if we had multiple dereferences, once one
failed it would exit the loop. If it didn't fail on the final dereference,
it didn't do anything which meant that it left whatever was in the ring
buffer unmodified. This caused the output to show garbage.
The goal here is to set the pointer to NULL as soon as an error is detected
but then let the processing continue. All processing would see the NULL (or
zero) as a fault and continue but would eventually zero out the destination
on the ring buffer.
-- Steve
prev parent reply other threads:[~2026-11-24 14:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 2:32 [PATCH v7] tracing/probes: Zero out faulted dereferenced fields Steven Rostedt
2026-11-24 2:51 ` sashiko-bot
2026-11-24 14:08 ` Steven Rostedt
2026-11-24 14:15 ` Masami Hiramatsu (Google)
2026-11-24 14:40 ` Steven Rostedt [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=20261124094019.75f52b60@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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