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: <CAP-5=fXug1ht3dVDpuG6hvzEYdexT9eH80E3B2NUraONXcCS=w@mail.gmail.com>
Date: Mon, 15 Jul 2024 09:56:04 -0700
From: Ian Rogers <irogers@...gle.com>
To: James Clark <james.clark@...aro.org>
Cc: linux-perf-users@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>, 
	Ingo Molnar <mingo@...hat.com>, Arnaldo Carvalho de Melo <acme@...nel.org>, 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>, "Liang, Kan" <kan.liang@...ux.intel.com>, 
	Athira Rajeev <atrajeev@...ux.vnet.ibm.com>, Leo Yan <leo.yan@...ux.dev>, 
	Yunseong Kim <yskelg@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf dso: Fix build when libunwind is enabled

On Mon, Jul 15, 2024 at 2:48 AM James Clark <james.clark@...aro.org> wrote:
>
> Now that symsrc_filename is always accessed through an accessor, we also
> need a free() function for it to avoid the following compilation error:
>
>   util/unwind-libunwind-local.c:416:12: error: lvalue required as unary
>     ‘&’ operand
>   416 |      zfree(&dso__symsrc_filename(dso));
>
> Fixes: 1553419c3c10 ("perf dso: Fix address sanitizer build")
> Signed-off-by: James Clark <james.clark@...aro.org>

And I wonder how this ever built..

Reviewed-by: Ian Rogers <irogers@...gle.com>

Thanks!
Ian

> ---
>  tools/perf/util/dso.c                    | 2 +-
>  tools/perf/util/dso.h                    | 5 +++++
>  tools/perf/util/unwind-libunwind-local.c | 2 +-
>  3 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
> index 2340c4f6d0c2..67414944f245 100644
> --- a/tools/perf/util/dso.c
> +++ b/tools/perf/util/dso.c
> @@ -1501,7 +1501,7 @@ void dso__delete(struct dso *dso)
>         auxtrace_cache__free(RC_CHK_ACCESS(dso)->auxtrace_cache);
>         dso_cache__free(dso);
>         dso__free_a2l(dso);
> -       zfree(&RC_CHK_ACCESS(dso)->symsrc_filename);
> +       dso__free_symsrc_filename(dso);
>         nsinfo__zput(RC_CHK_ACCESS(dso)->nsinfo);
>         mutex_destroy(dso__lock(dso));
>         RC_CHK_FREE(dso);
> diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
> index 878c1f441868..ed0068251c65 100644
> --- a/tools/perf/util/dso.h
> +++ b/tools/perf/util/dso.h
> @@ -602,6 +602,11 @@ static inline void dso__set_symsrc_filename(struct dso *dso, char *val)
>         RC_CHK_ACCESS(dso)->symsrc_filename = val;
>  }
>
> +static inline void dso__free_symsrc_filename(struct dso *dso)
> +{
> +       zfree(&RC_CHK_ACCESS(dso)->symsrc_filename);
> +}
> +
>  static inline enum dso_binary_type dso__symtab_type(const struct dso *dso)
>  {
>         return RC_CHK_ACCESS(dso)->symtab_type;
> diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
> index f6a6f6a91030..16c2b03831f3 100644
> --- a/tools/perf/util/unwind-libunwind-local.c
> +++ b/tools/perf/util/unwind-libunwind-local.c
> @@ -413,7 +413,7 @@ static int read_unwind_spec_debug_frame(struct dso *dso,
>                                                         __func__,
>                                                         dso__symsrc_filename(dso),
>                                                         debuglink);
> -                                       zfree(&dso__symsrc_filename(dso));
> +                                       dso__free_symsrc_filename(dso);
>                                 }
>                                 dso__set_symsrc_filename(dso, debuglink);
>                         } else {
> --
> 2.34.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ