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] [day] [month] [year] [list]
Message-ID: <CAM9d7cjWQWC6ECw2OYz_Qpv3iE6aG5V9qff_P2v9YXfsozZnGg@mail.gmail.com>
Date:   Wed, 7 Oct 2020 16:23:10 +0900
From:   Namhyung Kim <namhyung@...nel.org>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     "Song Bao Hua (Barry Song)" <song.bao.hua@...ilicon.com>,
        Andi Kleen <ak@...ux.intel.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Linuxarm <linuxarm@...wei.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Alexey Budankov <alexey.budankov@...ux.intel.com>
Subject: Re: [PATCH] perf evlist: fix memory corruption for Kernel PMU event

Hello,

On Tue, Oct 6, 2020 at 8:11 PM Jiri Olsa <jolsa@...hat.com> wrote:
>
> On Tue, Oct 06, 2020 at 06:39:44AM +0000, Song Bao Hua (Barry Song) wrote:
>
> SNIP
>
> > > > Andi, thanks! Could you share the link or the commit ID? I'd like to take a
> > > look at the fix.
> > > > I could still reproduce this issue in the latest linus' tree and I didn't find any
> > > commit
> > > > related to this issue in linux-next and tip/perf/core.
> > >
> > > I think Andi was referring to this discussion which is not merged yet:
> > >
> > > https://lore.kernel.org/lkml/20200922031346.15051-2-liwei391@huawei.co
> > > m/
> > >
> > > I suggested a patch at the end.  Can you please try it?
> >
> > I tried the patch you suggested.
> >
> > diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c
> > index 2208444ecb44..cfcdbd7be066 100644
> > --- a/tools/lib/perf/evlist.c
> > +++ b/tools/lib/perf/evlist.c
> > @@ -45,6 +45,9 @@ static void __perf_evlist__propagate_maps(struct perf_evlist *evlist,
> >          if (!evsel->own_cpus || evlist->has_user_cpus) {
> >                  perf_cpu_map__put(evsel->cpus);
> >                 evsel->cpus = perf_cpu_map__get(evlist->cpus);
> > +       } else if (!evsel->system_wide && perf_cpu_map__empty(evlist->cpus)) {
> > +               perf_cpu_map__put(evsel->cpus);
> > +               evsel->cpus = perf_cpu_map__get(evlist->cpus);
> >         } else if (evsel->cpus != evsel->own_cpus) {
> >                 perf_cpu_map__put(evsel->cpus);
> >                 evsel->cpus = perf_cpu_map__get(evsel->own_cpus);
> >
> > it did fix the crash I have seen on arm64. I'd prefer you put the below fixes tag in the commit log.
> > Fixes: 7736627b865d ("perf stat: Use affinity for closing file descriptors")
> > Perf stat began to crash from v5.4 kernel, so the fix should be backported to stable trees.
>
> awesome.. Namhyung, could you please send full patch?

Sure, I'll do!

Thanks
Namhyung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ