lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 22 Jan 2020 12:08:43 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>,
        "Naveen N . Rao" <naveen.n.rao@...ux.ibm.com>,
        Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
        "David S . Miller" <davem@...emloft.net>,
        Namhyung Kim <namhyung@...nel.org>,
        Toke Høiland-Jørgensen 
        <thoiland@...hat.com>, Jean-Tsung Hsiao <jhsiao@...hat.com>,
        Jesper Dangaard Brouer <brouer@...hat.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tracing/uprobe: Fix to make trace_uprobe_filter
 alignment safe

On Tue, 21 Jan 2020 10:50:55 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:

> On Tue, 21 Jan 2020 16:46:19 +0900
> Masami Hiramatsu <mhiramat@...nel.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@...radead.org>
> > Signed-off-by: Masami Hiramatsu <mhiramat@...nel.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@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ