All of lore.kernel.org
 help / color / mirror / Atom feed
* /tmp/perf-PID.map ownership
@ 2015-11-12 18:27 Brendan Gregg
  2015-11-12 18:52 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 6+ messages in thread
From: Brendan Gregg @ 2015-11-12 18:27 UTC (permalink / raw)
  To: linux-perf-use.

G'Day,

# perf record -F 99 -a -g -- sleep 30
[...]
# perf report -n --stdio
File /tmp/perf-25958.map not owned by current user or root, ignoring it.

Can root bypass this test? I'm root, and profiling apps from different
user-IDs, and the current workaround is to "chown root
/tmp/perf*.map". Shouldn't root be able to read these map files? Could
we:

--- linux-perf/tools/perf/util/symbol.c    2015-11-03 20:08:40.829320940 +0000
+++ linux-perf-edited/tools/perf/util/symbol.c    2015-11-12
18:21:35.487077872 +0000
@@ -1433,14 +1433,17 @@
     dso->adjust_symbols = 0;

     if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
+        uint_t euid;
         struct stat st;

         if (lstat(dso->name, &st) < 0)
             goto out;

-        if (st.st_uid && (st.st_uid != geteuid())) {
-            pr_warning("File %s not owned by current user or root, "
-                "ignoring it.\n", dso->name);
+        euid = geteuid();
+        if (euid && st.st_uid && (st.st_uid != euid)) {
+            pr_warning("File %s not owned by current user, and "
+                "current user is not root. Ignoring it.\n",
+                dso->name);
             goto out;
         }

Brendan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-12 20:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-12 18:27 /tmp/perf-PID.map ownership Brendan Gregg
2015-11-12 18:52 ` Arnaldo Carvalho de Melo
2015-11-12 18:59   ` Brendan Gregg
2015-11-12 19:04     ` Arnaldo Carvalho de Melo
2015-11-12 19:49       ` Arnaldo Carvalho de Melo
2015-11-12 20:01         ` Brendan Gregg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.