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] [day] [month] [year] [list]
Date:   Wed, 28 Nov 2018 17:19:20 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Eric Saint-Etienne <eric.saint.etienne@...cle.com>
Cc:     Linux Kernel <linux-kernel@...r.kernel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Darren Kenny <darren.kenny@...cle.com>,
        Eric Saint-Etienne <eric.saintetienne@...il.com>
Subject: Re: [PATCH v3] perf symbols: Cannot disassemble some routines when
 debuginfo present

On Wed, Nov 28, 2018 at 08:35:34AM -0800, Eric Saint-Etienne wrote:
> When the kernel is compiled with -ffunction-sections and perf uses the
> kernel debuginfo, perf fails the very first symbol lookup and ends up with
> an hex offset inside [kernel.vmlinux]. It's due to how perf loads the maps.
> 
> Indeed only .text gets loaded by map_groups__find() into al->map.
> Consequently al->map address range encompass the whole kernel image.
> But then map__load() loads many function maps by splitting al->map,
> which reduces al->map range drastically. Very likely the target address is
> then in one of those newly created function maps, so we need to lookup the
> map again to find that new map.
> 
> I'm not sure if this issue is only specific to the kernel but at least it
> occurs withe the kernel dso, and when we're not using the kernel debuginfo,
> perf will fallback to using kallsyms and then the first lookup will work.
> 
> The split of .text section happens in dso_process_kernel_symbol() where we
> call map_groups__find_by_name() to find an existing map, but with
> -ffunction-sections and a symbol belonging to a new (function) map, such
> map doesn't exist yet so we end up creating one and adjusting existing maps
> accordingly because adjust_kernel_syms is set there.
> 
> This patch makes sure that the event address we're looking-up is indeed
> within the map we've found, otherwise we lookup another map again.
> Only one extra lookup at most is required for the proper map to be found,
> if it exists.
> 
> Signed-off-by: Eric Saint-Etienne <eric.saint.etienne@...cle.com>
> Reviewed-by: Darren Kenny <darren.kenny@...cle.com>

Reviewed-by: Jiri Olsa <jolsa@...nel.org>

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ