diff options
author | David S. Miller <davem@davemloft.net> | 2011-08-20 10:39:12 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-20 10:39:12 -0700 |
commit | 823dcd2506fa369aeb8cbd26da5663efe2fda9a9 (patch) | |
tree | 853b3e3c05f0b9ee1b5df8464db19b7acc57150c /tools/perf/util/symbol.c | |
parent | eaa36660de7e174498618d69d7277d44a2f24c3d (diff) | |
parent | 98e77438aed3cd3343cbb86825127b1d9d2bea33 (diff) | |
download | talos-obmc-linux-823dcd2506fa369aeb8cbd26da5663efe2fda9a9.tar.gz talos-obmc-linux-823dcd2506fa369aeb8cbd26da5663efe2fda9a9.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index eec196329fd9..a8b53714542a 100644 --- 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; |