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, 05 May 2015 23:09:21 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Wang Nan <wangnan0@...wei.com>, ast@...mgrid.com,
	davem@...emloft.net, acme@...nel.org, mingo@...hat.com,
	a.p.zijlstra@...llo.nl, jolsa@...nel.org
CC:	lizefan@...nel.org, linux-kernel@...r.kernel.org, pi3orama@....com,
	hekuang@...wei.com
Subject: Re: [RFC PATCH 01/22] perf: probe: avoid segfault if passed with
 ''.

On 2015/04/30 19:52, Wang Nan wrote:
> Since parse_perf_probe_point() deals with a user passed argument, we
> should not assume it to be a valid string.
> 
> Without this patch, if pass '' to perf probe, a segfault raises:
> 
>  $ perf probe -a ''
>  Segmentation fault
> 
> This patch checks argument of parse_perf_probe_point() before
> string processing.
> 
> After this patch:
> 
>  $ perf probe -a ''
> 
>   usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
>      or: perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]
>      ...

This looks OK to me.

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

Could you split this as an independent bugfix with my ack?

Thank you,

> 
> Signed-off-by: Wang Nan <wangnan0@...wei.com>
> ---
>  tools/perf/util/probe-event.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index d8bb616..d05b77c 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -1084,6 +1084,8 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
>  	 *
>  	 * TODO:Group name support
>  	 */
> +	if (!arg)
> +		return -EINVAL;
>  
>  	ptr = strpbrk(arg, ";=@+%");
>  	if (ptr && *ptr == '=') {	/* Event name */
> 


-- 
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