projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
580cabe
)
perf symbols: Check '/tmp/perf-' symbol file ownership
author
Pekka Enberg
<
[email protected]
>
Tue, 9 Aug 2011 19:54:18 +0000
(22:54 +0300)
committer
Arnaldo Carvalho de Melo
<
[email protected]
>
Tue, 9 Aug 2011 18:23:08 +0000
(15:23 -0300)
The external symbol files are generated by JIT compilers, for example, but we
need to make sure they're ours before injecting them to 'perf report'.
Requested-by: Ingo Molnar <
[email protected]
>
Cc: Frederic Weisbecker <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Pekka Enberg <
[email protected]
>
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
tools/perf/util/symbol.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/symbol.c
b/tools/perf/util/symbol.c
index eec196329fd92c2e0567c8af5535ae1a99fcc4b1..a8b53714542a1524811a44120e330bf4d2ba94f7 100644
(file)
--- a/
tools/perf/util/symbol.c
+++ b/
tools/perf/util/symbol.c
@@
-1504,6
+1504,17
@@
int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
dso->adjust_symbols = 0;
if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
+ struct stat st;
+
+ if (stat(dso->name, &st) < 0)
+ return -1;
+
+ if (st.st_uid && (st.st_uid != geteuid())) {
+ pr_warning("File %s not owned by current user or root, "
+ "ignoring it.\n", dso->name);
+ return -1;
+ }
+
ret = dso__load_perf_map(dso, map, filter);
dso->symtab_type = ret > 0 ? SYMTAB__JAVA_JIT :
SYMTAB__NOT_FOUND;