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
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to