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:	Tue, 14 Apr 2015 01:03:55 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	He Kuang <hekuang@...wei.com>
CC:	acme@...nel.org, a.p.zijlstra@...llo.nl, mingo@...hat.com,
	namhyung@...nel.org, wangnan0@...wei.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] perf probe: Fix segfault when probe with lazy_line
 to file

(2015/04/13 20:41), He Kuang wrote:
> The first argument passed to find_probe_point_lazy() should be CU die,
> which will be passed to die_walk_lines() when lazy_line
> matches. Currently, when we probe with lazy_line pattern to file without
> function name, NULL pointer is passed and causes a segment fault.
> 
> Can be repoduced as following:
> 
>   $ perf probe -k vmlinux --add='fs/super.c;s->s_count=1;'
>   [ 1958.984658] perf[1020]: segfault at 10 ip 00007fc6e10d8c71 sp
>   00007ffcbfaaf900 error 4 in libdw-0.161.so[7fc6e10ce000+34000]
>   Segmentation fault
> 
> After this patch:
> 
>   $ perf probe -k vmlinux --add='fs/super.c;s->s_count=1;'
>   Added new event:
>   probe:_stext         (on @fs/super.c)
> 
>   You can now use it in all perf tools, such as:
>     perf record -e probe:_stext -aR sleep 1
> 

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>

Thanks!

> Signed-off-by: He Kuang <hekuang@...wei.com>
> ---
>  tools/perf/util/probe-finder.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
> index 431c12d..e91101b 100644
> --- a/tools/perf/util/probe-finder.c
> +++ b/tools/perf/util/probe-finder.c
> @@ -1067,7 +1067,7 @@ static int debuginfo__find_probes(struct debuginfo *dbg,
>  			if (pp->function)
>  				ret = find_probe_point_by_func(pf);
>  			else if (pp->lazy_line)
> -				ret = find_probe_point_lazy(NULL, pf);
> +				ret = find_probe_point_lazy(&pf->cu_die, pf);
>  			else {
>  				pf->lno = pp->line;
>  				ret = find_probe_point_by_line(pf);
> 


-- 
Masami HIRAMATSU
Linux Technology Research Center, System Productivity Research Dept.
Center for Technology Innovation - Systems Engineering
Hitachi, Ltd., Research & Development Group
E-mail: masami.hiramatsu.pt@...achi.com


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ