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: <CAM9d7ciWF-B7+YyEQd9D2DCdHPyLMdX0wMCFEihR41M8SJZKDw@mail.gmail.com>
Date:   Tue, 15 Sep 2020 11:54:44 +0900
From:   Namhyung Kim <namhyung@...nel.org>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        lkml <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Ingo Molnar <mingo@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Michael Petlan <mpetlan@...hat.com>,
        Song Liu <songliubraving@...com>,
        "Frank Ch. Eigler" <fche@...hat.com>,
        Ian Rogers <irogers@...gle.com>,
        Stephane Eranian <eranian@...gle.com>,
        Alexey Budankov <alexey.budankov@...ux.intel.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Adrian Hunter <adrian.hunter@...el.com>
Subject: Re: [PATCH 02/26] perf: Introduce mmap3 version of mmap event

Hi Jiri,

On Tue, Sep 15, 2020 at 4:38 AM Jiri Olsa <jolsa@...hat.com> wrote:
>
> On Mon, Sep 14, 2020 at 02:38:27PM +0900, Namhyung Kim wrote:
>
> SNIP
>
> > > diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> > > index 077e7ee69e3d..facfc3c673ed 100644
> > > --- a/include/uapi/linux/perf_event.h
> > > +++ b/include/uapi/linux/perf_event.h
> > > @@ -384,7 +384,8 @@ struct perf_event_attr {
> > >                                 aux_output     :  1, /* generate AUX records instead of events */
> > >                                 cgroup         :  1, /* include cgroup events */
> > >                                 text_poke      :  1, /* include text poke events */
> > > -                               __reserved_1   : 30;
> > > +                               mmap3          :  1, /* include bpf events */
> >
> > ???
> >
> > > +                               __reserved_1   : 29;
> > >
> > >         union {
> > >                 __u32           wakeup_events;    /* wakeup every n events */
> > > @@ -1060,6 +1061,30 @@ enum perf_event_type {
> > >          */
> > >         PERF_RECORD_TEXT_POKE                   = 20,
> > >
> > > +       /*
> > > +        * The MMAP3 records are an augmented version of MMAP2, they add
> > > +        * build id value to identify the exact binary behind map
> > > +        *
> > > +        * struct {
> > > +        *      struct perf_event_header        header;
> > > +        *
> > > +        *      u32                             pid, tid;
> > > +        *      u64                             addr;
> > > +        *      u64                             len;
> > > +        *      u64                             pgoff;
> > > +        *      u32                             maj;
> > > +        *      u32                             min;
> > > +        *      u64                             ino;
> > > +        *      u64                             ino_generation;
> > > +        *      u32                             prot, flags;
> > > +        *      u32                             reserved;
> > > +        *      u8                              buildid[20];
> > > +        *      char                            filename[];
> > > +        *      struct sample_id                sample_id;
> > > +        * };
> > > +        */
> > > +       PERF_RECORD_MMAP3                       = 21,
> > > +
> > >         PERF_RECORD_MAX,                        /* non-ABI */
> > >  };
> > >
> > [SNIP]
> > > @@ -8098,6 +8116,9 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
> > >         mmap_event->prot = prot;
> > >         mmap_event->flags = flags;
> > >
> > > +       if (atomic_read(&nr_mmap3_events))
> > > +               build_id_parse(vma, mmap_event->buildid);
> >
> > What about if it failed?  We should zero out the build-id..
>
> it is initialized to zero in perf_event_mmap
>
>         mmap_event = (struct perf_mmap_event){
>                 .vma    = vma,
>         ...
>
> I'll double check build_id_parse won't leave anything half
> baked there, but I dont think so

Oh, you're right.  I missed that..

Thanks
Namhyung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ