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: <20180419025424.GC13370@sejong>
Date:   Thu, 19 Apr 2018 11:54:24 +0900
From:   Namhyung Kim <namhyung@...nel.org>
To:     Kim Phillips <kim.phillips@....com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...hat.com>, Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Jiri Olsa <jolsa@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>, kernel-team@....com
Subject: Re: [PATCH] perf tools: set kernel end address properly

On Wed, Apr 18, 2018 at 07:37:59PM -0500, Kim Phillips wrote:
> diff --git a/tools/perf/arch/arm64/util/sym-handling.c b/tools/perf/arch/arm64/util/sym-handling.c
> index 0051b1ee8450..5c4a2e208bbc 100644
> --- a/tools/perf/arch/arm64/util/sym-handling.c
> +++ b/tools/perf/arch/arm64/util/sym-handling.c
> @@ -20,3 +20,16 @@ bool elf__needs_adjust_symbols(GElf_Ehdr ehdr)
>                ehdr.e_type == ET_DYN;
>  }
>  #endif
> +
> +const char *arch__normalize_symbol_name(const char *name)
> +{
> +       /* 
> +        * arm64 kernels compensating for a CPU erratum can put up a 
> +        * module_emit_adrp_veneer in place of a module_emit_plt_entry
> +        */
> +       if (name && strlen(name) >= 23 &&
> +           !strncmp(name, "module_emit_adrp_veneer", 23))
> +               return "module_emit_plt_entry";
> +
> +       return name;
> +}

I don't know it's always preferable or just for the test.  It it's the
latter it may be better to move it to the test code.


> diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
> index 1e5adb65632a..07064e76947d 100644
> --- a/tools/perf/tests/vmlinux-kallsyms.c
> +++ b/tools/perf/tests/vmlinux-kallsyms.c
> @@ -163,6 +163,29 @@ int test__vmlinux_matches_kallsyms(struct test *test __maybe_unused, int subtest
>  
>                                 continue;
>                         }
> +               } else if (pair) {
> +                       s64 skew = mem_start - UM(pair->start);
> +                       struct map *kmap = map_groups__find(&kallsyms.kmaps, type, mem_start);
> +                       struct map *vmap = map_groups__find(&vmlinux.kmaps, type, mem_start);
> +
> +                       /* 
> +                        * arm64 kernels compensating for a CPU erratum can put up a 
> +                        * module_emit_adrp_veneer in place of a module_emit_plt_entry
> +                        */
> +                       if (llabs(skew) < page_size)

It seems that we needs to check it's the ARM64 at least.  If it's a
rare case we might need to add more paranoid checks.

Thanks,
Namhyung


> +                       {
> +                               pr_debug("NO ERR FOR SKEW %ld: %#" PRIx64 ": diff start addr v: %s k: %#" PRIx64 " %s\n",
> +                                        skew, mem_start, sym->name, UM(pair->start), pair->name);
> +                               continue;
> +                       }
> +
> +                       pr_debug("ERR : %#" PRIx64 ": diff start addr v: %s k: %#" PRIx64 " %s\n",
> +                                mem_start, sym->name, UM(pair->start), pair->name);
> +
> +                       if (kmap && vmap) {
> +                               pr_debug("    : map v: %s k: %s\n",
> +                                        vmap->dso->short_name, kmap->dso->short_name);
> +                       }
>                 } else
>                         pr_debug("ERR : %#" PRIx64 ": %s not on kallsyms\n",
>                                  mem_start, sym->name);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ