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: <5593C843.6000200@hitachi.com>
Date:	Wed, 01 Jul 2015 20:00:19 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	He Kuang <hekuang@...wei.com>, acme@...nel.org,
	a.p.zijlstra@...llo.nl, mingo@...hat.com, namhyung@...nel.org,
	jolsa@...nel.org
CC:	wangnan0@...wei.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] perf probe: Add failure check when show variable
 range

On 2015/07/01 18:05, He Kuang wrote:
> Change improper type size_t to diffptr_t to make consistent with libdw
> and handle error code.
> 
> Signed-off-by: He Kuang <hekuang@...wei.com>
> ---
>  tools/perf/util/dwarf-aux.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
> index 2cb4c82..da96eb1 100644
> --- a/tools/perf/util/dwarf-aux.c
> +++ b/tools/perf/util/dwarf-aux.c
> @@ -965,7 +965,7 @@ static int die_get_var_innermost_scope(Dwarf_Die *sp_die, Dwarf_Die *vr_die,
>  {
>  	Dwarf_Die *scopes;
>  	int count;
> -	size_t offset = 0;
> +	ptrdiff_t offset = 0;
>  	Dwarf_Addr base;
>  	Dwarf_Addr start, end;
>  	Dwarf_Addr entry;
> @@ -991,6 +991,9 @@ static int die_get_var_innermost_scope(Dwarf_Die *sp_die, Dwarf_Die *vr_die,
>  
>  	while ((offset = dwarf_ranges(&scopes[1], offset, &base,
>  				&start, &end)) > 0) {
> +		if (offset < 0)
> +			goto out;

Hmm, here offset always > 0, see the condition carefully.
Perhaps, this should be placed at the right after the while loop.

> +
>  		start -= entry;
>  		end -= entry;
>  
> @@ -1029,7 +1032,7 @@ int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, struct strbuf *buf)
>  	Dwarf_Addr entry;
>  	Dwarf_Op *op;
>  	size_t nops;
> -	size_t offset = 0;
> +	ptrdiff_t offset = 0;
>  	Dwarf_Attribute attr;
>  	bool first = true;
>  	const char *name;
> @@ -1048,6 +1051,9 @@ int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, struct strbuf *buf)
>  	while ((offset = dwarf_getlocations(
>  				&attr, offset, &base,
>  				&start, &end, &op, &nops)) > 0) {
> +		if (offset < 0)
> +			return offset;

Ditto.

Thanks,

> +
>  		if (start == 0) {
>  			/* Single Location Descriptions */
>  			ret = die_get_var_innermost_scope(sp_die, vr_die, buf);
> 


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