From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "Peter Zijlstra" <peterz@infradead.org>,
"Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Jiri Olsa" <jolsa@kernel.org>, "Ingo Molnar" <mingo@kernel.org>,
"Naveen N . Rao" <naveen.n.rao@linux.ibm.com>,
"Anil S Keshavamurthy" <anil.s.keshavamurthy@intel.com>,
"David S . Miller" <davem@davemloft.net>,
"Namhyung Kim" <namhyung@kernel.org>,
"Toke Høiland-Jørgensen" <thoiland@redhat.com>,
"Jean-Tsung Hsiao" <jhsiao@redhat.com>,
"Jesper Dangaard Brouer" <brouer@redhat.com>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing/uprobe: Fix to make trace_uprobe_filter alignment safe
Date: Wed, 22 Jan 2020 12:08:43 +0900 [thread overview]
Message-ID: <20200122120843.493c7bd2718371af25787206@kernel.org> (raw)
In-Reply-To: <20200121105055.6a8b097e@gandalf.local.home>
On Tue, 21 Jan 2020 10:50:55 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Tue, 21 Jan 2020 16:46:19 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> > Commit 99c9a923e97a ("tracing/uprobe: Fix double perf_event
> > linking on multiprobe uprobe") moved trace_uprobe_filter on
> > trace_probe_event. However, since it introduced a flexible
> > data structure with char array and type casting, the
> > alignment of trace_uprobe_filter can be broken.
> >
> > This changes the type of the array to trace_uprobe_filter
> > data strucure to fix it.
> >
> > Fixes: 99c9a923e97a ("tracing/uprobe: Fix double perf_event linking on multiprobe uprobe")
> > Suggested-by: Peter Zijlstra <peterz@infradead.org>
> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> > ---
> > kernel/trace/trace_kprobe.c | 2 +-
> > kernel/trace/trace_probe.c | 9 ++++++---
> > kernel/trace/trace_probe.h | 10 ++++++++--
> > kernel/trace/trace_uprobe.c | 29 +++++++----------------------
> > 4 files changed, 22 insertions(+), 28 deletions(-)
>
>
> I hit the following build error with this:
Hmm, I missed something... let me check and update it.
Thank you,
>
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c: In function ‘alloc_trace_uprobe’:
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c:355:39: error: ‘tu->tp.event’ is a pointer; did you mean to use ‘->’?
> init_trace_uprobe_filter(tu->tp.event.filter);
> ^
> ->
> In file included from /work/git/linux-trace.git/arch/x86/include/asm/bug.h:83,
> from /work/git/linux-trace.git/include/linux/bug.h:5,
> from /work/git/linux-trace.git/arch/x86/include/asm/paravirt.h:15,
> from /work/git/linux-trace.git/arch/x86/include/asm/irqflags.h:72,
> from /work/git/linux-trace.git/include/linux/irqflags.h:16,
> from /work/git/linux-trace.git/include/linux/rcupdate.h:26,
> from /work/git/linux-trace.git/include/linux/rbtree.h:22,
> from /work/git/linux-trace.git/include/linux/key.h:15,
> from /work/git/linux-trace.git/include/linux/security.h:26,
> from /work/git/linux-trace.git/kernel/trace/trace_uprobe.c:10:
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c: In function ‘__probe_event_disable’:
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c:1064:46: error: ‘tu->tp.event’ is a pointer; did you mean to use ‘->’?
> WARN_ON(!uprobe_filter_is_empty(tu->tp.event.filter));
> ^
> /work/git/linux-trace.git/include/asm-generic/bug.h:113:25: note: in definition of macro ‘WARN_ON’
> int __ret_warn_on = !!(condition); \
> ^~~~~~~~~
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c: In function ‘probe_event_enable’:
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c:1105:46: error: ‘tu->tp.event’ is a pointer; did you mean to use ‘->’?
> WARN_ON(!uprobe_filter_is_empty(tu->tp.event.filter));
> ^
> /work/git/linux-trace.git/include/asm-generic/bug.h:113:25: note: in definition of macro ‘WARN_ON’
> int __ret_warn_on = !!(condition); \
> ^~~~~~~~~
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c: In function ‘uprobe_perf_close’:
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c:1269:45: error: ‘tu->tp.event’ is a pointer; did you mean to use ‘->’?
> if (trace_uprobe_filter_remove(tu->tp.event.filter, event))
> ^
> ->
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c: In function ‘uprobe_perf_open’:
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c:1294:42: error: ‘tu->tp.event’ is a pointer; did you mean to use ‘->’?
> if (trace_uprobe_filter_add(tu->tp.event.filter, event))
> ^
> ->
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c: In function ‘uprobe_perf_filter’:
> /work/git/linux-trace.git/kernel/trace/trace_uprobe.c:1316:23: error: ‘tu->tp.event’ is a pointer; did you mean to use ‘->’?
> filter = tu->tp.event.filter;
> ^
> ->
> make[3]: *** [/work/git/linux-trace.git/scripts/Makefile.build:266: kernel/trace/trace_uprobe.o] Error 1
> make[3]: *** Waiting for unfinished jobs....
>
>
> Config attached.
>
> -- Steve
--
Masami Hiramatsu <mhiramat@kernel.org>
next prev parent reply other threads:[~2020-01-22 3:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 1:45 [PATCH] tracing/uprobe: Fix double perf_event linking on multiprobe uprobe Masami Hiramatsu
2020-01-10 1:47 ` Masami Hiramatsu
2020-01-14 17:35 ` Arnaldo Carvalho de Melo
2020-01-14 17:44 ` Steven Rostedt
2020-01-14 17:45 ` Arnaldo Carvalho de Melo
2020-01-14 18:32 ` Steven Rostedt
2020-01-15 1:44 ` Masami Hiramatsu
2020-01-20 12:40 ` Peter Zijlstra
2020-01-20 15:32 ` Masami Hiramatsu
2020-01-21 7:46 ` [PATCH] tracing/uprobe: Fix to make trace_uprobe_filter alignment safe Masami Hiramatsu
2020-01-21 15:50 ` Steven Rostedt
2020-01-22 3:08 ` Masami Hiramatsu [this message]
2020-01-22 3:23 ` [PATCH v2] " Masami Hiramatsu
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=20200122120843.493c7bd2718371af25787206@kernel.org \
--to=mhiramat@kernel.org \
--cc=acme@kernel.org \
--cc=anil.s.keshavamurthy@intel.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=jhsiao@redhat.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=naveen.n.rao@linux.ibm.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=thoiland@redhat.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).