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: <CAM9d7cisp7QQJF8RT7fPW4rQ4tTrZtK8PM61fKGFKGE-xHqevw@mail.gmail.com>
Date:   Mon, 7 Sep 2020 22:22:25 +0900
From:   Namhyung Kim <namhyung@...nel.org>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Stephane Eranian <eranian@...gle.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Andi Kleen <andi@...stfloor.org>,
        Ian Rogers <irogers@...gle.com>
Subject: Re: [PATCH 1/9] perf evlist: Fix cpu/thread map leak

Hi Jiri,

On Mon, Sep 7, 2020 at 8:32 PM Jiri Olsa <jolsa@...hat.com> wrote:
>
> On Mon, Sep 07, 2020 at 01:29:29PM +0200, Jiri Olsa wrote:
> > On Mon, Sep 07, 2020 at 12:44:54PM +0900, Namhyung Kim wrote:
> > > Asan reported leak of cpu and thread maps as they have one more
> > > refcount than released.  I found that after setting evlist maps it
> > > should release it's refcount.
> > >
> > > It seems to be broken from the beginning so I chose the original
> > > commit as the culprit.  But not sure how it's applied to stable trees
> > > since there are many changes in the code after that.
> > >
> > > Fixes: 7e2ed097538c5 ("perf evlist: Store pointer to the cpu and thread maps")
> > > Fixes: 4112eb1899c0e ("perf evlist: Default to syswide target when no thread/cpu maps set")
> > > Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> > > ---
> > >  tools/perf/util/evlist.c | 11 ++++++++---
> > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> > > index e3fa3bf7498a..c0768c61eb43 100644
> > > --- a/tools/perf/util/evlist.c
> > > +++ b/tools/perf/util/evlist.c
> > > @@ -946,6 +946,10 @@ int perf_evlist__create_maps(struct evlist *evlist, struct target *target)
> > >
> > >     perf_evlist__set_maps(&evlist->core, cpus, threads);
> > >
> > > +   /* as evlist now has references, put count here */
> > > +   perf_cpu_map__put(cpus);
> > > +   perf_thread_map__put(threads);
> >
> > nice catch, I checked perf_evlist__create_syswide_maps is doing this
>
> because you fixed that :))) missed the rest of the patch.. sry

No worries and thanks for the review! :)

Namhyung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ