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: <YdG9CSk9ayoVmBhz@kernel.org>
Date:   Sun, 2 Jan 2022 11:56:09 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Zechuan Chen <chenzechuan1@...wei.com>,
        "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
        Masami Hiramatsu <mhiramat@...nel.org>
Cc:     peterz@...radead.org, mingo@...hat.com, mark.rutland@....com,
        alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
        namhyung@...nel.org, Jianlin.Lv@....com,
        ravi.bangoria@...ux.ibm.com, yao.jin@...ux.intel.com,
        yangjihong1@...wei.com, mpe@...erman.id.au,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] powerpc/perf: fix ppc64 perf probe add events failed

Em Tue, Dec 28, 2021 at 07:13:38PM +0800, Zechuan Chen escreveu:
> Because of commit bf794bf52a80 ("powerpc/kprobes: Fix kallsyms lookup
> across powerpc ABIv1 and ABIv2"), in ppc64 ABIv1, our perf command
> eliminates the need to use the prefix "." at the symbol name. But when
> the command "perf probe -a schedule" is executed on ppc64 ABIv1, it
> obtains two symbol address information through /proc/kallsyms, for example:
> 
> cat /proc/kallsyms | grep -w schedule
> c000000000657020 T .schedule
> c000000000d4fdb8 D schedule
> 
> The symbol "D schedule" is not a function symbol, and perf will print:
> "p:probe/schedule _text+13958584"Failed to write event: Invalid argument
> 
> Therefore, when searching symbols from map and adding probe point for
> them, a symbol type check is added. If the type of symbol is not a
> function, skip it.
> 
> Fixes: bf794bf52a80 ("powerpc/kprobes: Fix kallsyms lookup across powerpc ABIv1 and ABIv2")
> 
> Signed-off-by: Zechuan Chen <chenzechuan1@...wei.com>
> ---
>  tools/perf/util/probe-event.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index b2a02c9ab8ea..a834918a0a0d 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -3083,6 +3083,9 @@ static int find_probe_trace_events_from_map(struct perf_probe_event *pev,
>  	for (j = 0; j < num_matched_functions; j++) {
>  		sym = syms[j];
>  
> +		if (sym->type != STT_FUNC)
> +			continue;
> +

Humm, shouldn't this be handled by find_probe_functions(), i.e. it
shoudn't return data symbols, right? Otherwise other places using this
function may malfunction as well?

Naveen? Masami?

- Arnaldo

>  		/* There can be duplicated symbols in the map */
>  		for (i = 0; i < j; i++)
>  			if (sym->start == syms[i]->start) {
> -- 
> 2.12.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ