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: <50399556C9727B4D88A595C8584AAB3752604844@GSjpTKYDCembx32.service.hitachi.net>
Date:	Thu, 5 Nov 2015 14:08:48 +0000
From:	平松雅巳 / HIRAMATU,MASAMI 
	<masami.hiramatsu.pt@...achi.com>
To:	"'Wang Nan'" <wangnan0@...wei.com>,
	"acme@...nel.org" <acme@...nel.org>,
	"namhyung@...nel.org" <namhyung@...nel.org>
CC:	"lizefan@...wei.com" <lizefan@...wei.com>,
	"pi3orama@....com" <pi3orama@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"jolsa@...nel.org" <jolsa@...nel.org>,
	Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: RE: [PATCH 2/2] perf tools: Fix find_perf_probe_point_from_map()
 which incorrectly returns success

From: Wang Nan [mailto:wangnan0@...wei.com]
>
>It is possible that find_perf_probe_point_from_map() fails to find
>symbol but still returns 0 because of an small error when coding:
>find_perf_probe_point_from_map() set 'ret' to error code at first,
>but also use it to hold return value of
>kernel_get_symbol_address_by_name().

OK, I didn't expect that there is a symbol which can be found by 
kernel_get_symbol_address_by_name() but not by __find_kernel_function()...
Would you have any example of the error?

>
>This patch resets 'ret' to error even kernel_get_symbol_address_by_name()
>success, so if !sym, the whole function returns error correctly.

Hmm, that sounds tricky. I'd rather like to add *psym to kernel_get_symbol_address_by_name() 
to save symbol and don't use __find_kernel_function() instead.

Thank you,

>
>Signed-off-by: Wang Nan <wangnan0@...wei.com>
>Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
>Cc: Jiri Olsa <jolsa@...nel.org>
>Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
>Cc: Namhyung Kim <namhyung@...nel.org>
>---
> 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 b51a8bf..e659c4f 100644
>--- a/tools/perf/util/probe-event.c
>+++ b/tools/perf/util/probe-event.c
>@@ -1905,6 +1905,9 @@ static int find_perf_probe_point_from_map(struct probe_trace_point *tp,
> 			sym = __find_kernel_function(addr, &map);
> 		}
> 	}
>+
>+	/* ret may has be overwritten so reset it */
>+	ret = -ENOENT;
> 	if (!sym)
> 		goto out;
>
>--
>1.8.3.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ