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]
Message-Id: <20200121003223.b823d8ccefc38f3220869618@kernel.org>
Date:   Tue, 21 Jan 2020 00:32:23 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Steven Rostedt <rostedt@...dmis.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 double perf_event linking on
 multiprobe uprobe

On Mon, 20 Jan 2020 13:40:22 +0100
Peter Zijlstra <peterz@...radead.org> wrote:

> On Fri, Jan 10, 2020 at 10:45:39AM +0900, Masami Hiramatsu wrote:
> 
> > diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
> > index 4ee703728aec..03e4e180058d 100644
> > --- a/kernel/trace/trace_probe.h
> > +++ b/kernel/trace/trace_probe.h
> > @@ -230,6 +230,7 @@ struct trace_probe_event {
> >  	struct trace_event_call		call;
> >  	struct list_head 		files;
> >  	struct list_head		probes;
> > +	char				data[0];
> >  };
> 
> Would it make sense to make the above:
> 
> 	struct trace_uprobe_filter	filter[0];
> 
> instead? That would ensure that alignment is respected. While I think
> the current code works by accident.

Hmm, if we consider the alignment, shouldn't we allocate the structure
with the alignment gap? Currently it just added the 
sizeof(struct trace_uprobe_filter) when kzalloc().

In this case, I think we should introduce a new data structure,
trace_uprobe_event.

Thank you,

> 
> > @@ -264,6 +263,14 @@ process_fetch_insn(struct fetch_insn *code, struct pt_regs *regs, void *dest,
> >  }
> >  NOKPROBE_SYMBOL(process_fetch_insn)
> >  
> > +static struct trace_uprobe_filter *
> > +trace_uprobe_get_filter(struct trace_uprobe *tu)
> > +{
> > +	struct trace_probe_event *event = tu->tp.event;
> > +
> > +	return (struct trace_uprobe_filter *)&event->data[0];
> > +}
> 
> 


-- 
Masami Hiramatsu <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ