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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fWGfaTwhJRHWUZgRwb4Z16C=zdWWjb8eeQB6PReEtw9Sw@mail.gmail.com>
Date:   Thu, 30 Nov 2023 10:23:31 -0800
From:   Ian Rogers <irogers@...gle.com>
To:     Chengen Du <chengen.du@...onical.com>
Cc:     namhyung@...nel.org, peterz@...radead.org, mingo@...hat.com,
        acme@...nel.org, mark.rutland@....com,
        alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
        adrian.hunter@...el.com, linux-perf-users@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf symbols: Parse NOTE segments until the build id is found

On Thu, Nov 30, 2023 at 5:57 AM Chengen Du <chengen.du@...onical.com> wrote:
>
> In the ELF file, multiple NOTE segments may exist.
> To locate the build id, the process shall persist
> in parsing NOTE segments until the build id is found.
>
> Signed-off-by: Chengen Du <chengen.du@...onical.com>

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

For this code to be run then libelf needs to be disabled, I guess this
is why the problem has existed, out of curiosity why not use libelf?
If you look at tools/perf/Makefile.config, disabling libelf disables
libbpf, which means a whole heap of perf tool features are going to be
missing for you.

It may also be possible to add:
Fixes b691f64360ec ("perf symbols: Implement poor man's ELF parser")

Thanks,
Ian

> ---
>  tools/perf/util/symbol-minimal.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
> index a81a14769bd1..1da8b713509c 100644
> --- a/tools/perf/util/symbol-minimal.c
> +++ b/tools/perf/util/symbol-minimal.c
> @@ -159,9 +159,10 @@ int filename__read_build_id(const char *filename, struct build_id *bid)
>                                 goto out_free;
>
>                         ret = read_build_id(buf, buf_size, bid, need_swap);
> -                       if (ret == 0)
> +                       if (ret == 0) {
>                                 ret = bid->size;
> -                       break;
> +                               break;
> +                       }
>                 }
>         } else {
>                 Elf64_Ehdr ehdr;
> @@ -210,9 +211,10 @@ int filename__read_build_id(const char *filename, struct build_id *bid)
>                                 goto out_free;
>
>                         ret = read_build_id(buf, buf_size, bid, need_swap);
> -                       if (ret == 0)
> +                       if (ret == 0) {
>                                 ret = bid->size;
> -                       break;
> +                               break;
> +                       }
>                 }
>         }
>  out_free:
> --
> 2.40.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ