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] [day] [month] [year] [list]
Message-ID: <tip-dc6254cf870732804b76a83ff2d8a72fea4365f6@git.kernel.org>
Date:	Wed, 18 Feb 2015 10:26:20 -0800
From:	tip-bot for Victor Kamensky <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	acme@...hat.com, anton@...ba.org, a.p.zijlstra@...llo.nl,
	linux@....linux.org.uk, linux-kernel@...r.kernel.org,
	namhyung@...nel.org, adrian.hunter@...el.com, Dave.Martin@....com,
	tglx@...utronix.de, Waiman.Long@...com,
	masami.hiramatsu.pt@...achi.com, jolsa@...hat.com,
	victor.kamensky@...aro.org, mingo@...nel.org, will.deacon@....com,
	paulus@...ba.org, dsahern@...il.com, hpa@...or.com,
	avi@...udius-systems.com
Subject: [tip:perf/core] perf symbols:
  debuglink should take symfs option into account

Commit-ID:  dc6254cf870732804b76a83ff2d8a72fea4365f6
Gitweb:     http://git.kernel.org/tip/dc6254cf870732804b76a83ff2d8a72fea4365f6
Author:     Victor Kamensky <victor.kamensky@...aro.org>
AuthorDate: Mon, 26 Jan 2015 22:34:02 -0800
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 6 Feb 2015 11:46:36 +0100

perf symbols: debuglink should take symfs option into account

Currently code that tries to read corresponding debug symbol file from
.gnu_debuglink section (DSO_BINARY_TYPE__DEBUGLINK) does not take in
account symfs option, so filename__read_debuglink function cannot open
ELF file, if symfs option is used.

Fix is to add proper handling of symfs as it is done in other places:
use __symbol__join_symfs function to get real file name of target ELF
file.

Signed-off-by: Victor Kamensky <victor.kamensky@...aro.org>
Tested-by: David Ahern <dsahern@...il.com>
Acked-by: David Ahern <dsahern@...il.com>
Acked-by: Namhyung Kim <namhyung@...nel.org>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Anton Blanchard <anton@...ba.org>
Cc: Avi Kivity <avi@...udius-systems.com>
Cc: Dave Martin <Dave.Martin@....com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Russell King <linux@....linux.org.uk>
Cc: Waiman Long <Waiman.Long@...com>
Cc: Will Deacon <will.deacon@....com>
Cc: linux-arm-kernel@...ts.infradead.org
Link: http://lkml.kernel.org/r/1422340442-4673-3-git-send-email-victor.kamensky@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/dso.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index a8b3f18..814554d 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -45,13 +45,13 @@ int dso__read_binary_type_filename(const struct dso *dso,
 	case DSO_BINARY_TYPE__DEBUGLINK: {
 		char *debuglink;
 
-		strncpy(filename, dso->long_name, size);
-		debuglink = filename + dso->long_name_len;
+		len = __symbol__join_symfs(filename, size, dso->long_name);
+		debuglink = filename + len;
 		while (debuglink != filename && *debuglink != '/')
 			debuglink--;
 		if (*debuglink == '/')
 			debuglink++;
-		ret = filename__read_debuglink(dso->long_name, debuglink,
+		ret = filename__read_debuglink(filename, debuglink,
 					       size - (debuglink - filename));
 		}
 		break;
--
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