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]
Date:   Thu, 15 Jun 2023 16:02:37 +0200
From:   Georg Müller <georgmueller@....net>
To:     "Masami Hiramatsu (Google)" <mhiramat@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        Steven Rostedt <rostedt@...dmis.org>,
        regressions@...ts.linux.dev
Subject: Re: [PATCH v2 3/3] tools/perf: Fix to get declared file name from
 clang DWARF5

Hi all,

I have found a solution for this bug and will post a patch later today.

Am 09.06.23 um 14:21 schrieb Georg Müller:
>
> Am 01.11.22 um 14:48 schrieb Masami Hiramatsu (Google):
>> From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
>>
>> Fix to get the declared file name even if it uses file index 0
>> in DWARF5, using custom die_get_decl_file() function.
>>
>
> this patch breaks perf probe on fedora 38.
>

The problem is that die_get_file_name() uses the wrong cu_die.

I was pointed to the solution by reading elfutils commit e1db5cdc9:

     dwarf_decl_file uses dwarf_attr_integrate to get the DW_AT_decl_file
     attribute. This means the attribute might come from a different DIE
     in a different CU. If so, we need to use the CU associated with the
     attribute, not the original DIE, to resolve the file name.

The correct cu_die has to be obtained via

     dwarf_attr_integrate(dw_die, DW_AT_decl_file, &attr_mem)

and then cu_die from the cu from attr_mem (dwarf_cu_die(attr_mem.cu, &cu_die, ...)
to obtain it) has to be used.

Best regards,
Georg

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ