[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fUA8T9B2RvXg-Hpj_fHXmwB18ah6Krm3qm5ULH-M04Lqw@mail.gmail.com>
Date: Tue, 13 Aug 2024 09:04:57 -0700
From: Ian Rogers <irogers@...gle.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Namhyung Kim <namhyung@...nel.org>, Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>, Kan Liang <kan.liang@...ux.intel.com>,
Thomas Richter <tmricht@...ux.ibm.com>, Kajol Jain <kjain@...ux.ibm.com>,
Athira Rajeev <atrajeev@...ux.vnet.ibm.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 1/2] perf disasm: Fix memory leak for locked operations
On Tue, Aug 13, 2024 at 7:53 AM Arnaldo Carvalho de Melo
<acme@...nel.org> wrote:
>
> On Mon, Aug 12, 2024 at 09:06:12PM -0700, Ian Rogers wrote:
> > lock__parse calls disasm_line__parse passing
> > &ops->locked.ins.name. Ensure ops->locked.ins.name is freed in
> > lock__delete.
> >
> > Found with lock/leak sanitizer.
Ooops, I meant address/leak sanitizer.
> Applied both patches to perf-tools-next.
Thanks, could you fix the commit message.
Thanks,
Ian
> Thanks,
>
> - Arnaldo
>
> > Signed-off-by: Ian Rogers <irogers@...gle.com>
> > ---
> > tools/perf/util/disasm.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c
> > index 22289003e16d..226d2181f694 100644
> > --- a/tools/perf/util/disasm.c
> > +++ b/tools/perf/util/disasm.c
> > @@ -566,6 +566,7 @@ static void lock__delete(struct ins_operands *ops)
> > ins_ops__delete(ops->locked.ops);
> >
> > zfree(&ops->locked.ops);
> > + zfree(&ops->locked.ins.name);
> > zfree(&ops->target.raw);
> > zfree(&ops->target.name);
> > }
> > --
> > 2.46.0.76.ge559c4bf1a-goog
Powered by blists - more mailing lists