From: Steven Rostedt <rostedt@goodmis.org>
To: Ian Rogers <irogers@google.com>
Cc: linux-trace-devel@vger.kernel.org,
Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Subject: Re: [PATCH v1 1/2] libtracefs: Move initialization below a null test.
Date: Thu, 15 Dec 2022 14:02:03 -0500 [thread overview]
Message-ID: <20221215140203.103faf50@gandalf.local.home> (raw)
In-Reply-To: <20221215183151.2685460-1-irogers@google.com>
On Thu, 15 Dec 2022 10:31:50 -0800
Ian Rogers <irogers@google.com> wrote:
> Computing the address from a NULL pointer results in undefined behavior
> which things like undefined behavior sanitizer promote into real
> failures.
I thought commit aff006d4af0c7 ("libtracefs: Do not initialize with NULL
offsets") was suppose to fix this.
Oh, I think I may have forgotten to remove the check against dynevent!
Does this work instead?
-- Steve
diff --git a/src/tracefs-dynevents.c b/src/tracefs-dynevents.c
index 48bb26a96c58..7a3c45ce25a3 100644
--- a/src/tracefs-dynevents.c
+++ b/src/tracefs-dynevents.c
@@ -713,9 +713,6 @@ dynevent_info(struct tracefs_dynevent *dynevent, char **system,
&dynevent->address, &dynevent->format };
int i;
- if (!dynevent)
- return TRACEFS_DYNEVENT_UNKNOWN;
-
for (i = 0; i < ARRAY_SIZE(lv); i++) {
if (lv[i]) {
if (*rv[i]) {
next prev parent reply other threads:[~2022-12-15 19:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-15 18:31 [PATCH v1 1/2] libtracefs: Move initialization below a null test Ian Rogers
2022-12-15 18:31 ` [PATCH v1 2/2] libtracefs: Fix compiler -Wmemsize-comparison warning Ian Rogers
2022-12-15 19:03 ` Steven Rostedt
2022-12-15 19:02 ` Steven Rostedt [this message]
2022-12-15 20:13 ` [PATCH v1 1/2] libtracefs: Move initialization below a null test Ian Rogers
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=20221215140203.103faf50@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=irogers@google.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=tz.stoyanov@gmail.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;
as well as URLs for NNTP newsgroup(s).