All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: "linux-perf-use." <linux-perf-users@vger.kernel.org>
Subject: Re: /tmp/perf-PID.map ownership
Date: Thu, 12 Nov 2015 15:52:05 -0300	[thread overview]
Message-ID: <20151112185205.GA7160@kernel.org> (raw)
In-Reply-To: <CAE40pdctG6CUcmangzqSKmd7GkSv1oz7jP5hR-=GFSTTeQ-2sQ@mail.gmail.com>

Em Thu, Nov 12, 2015 at 10:27:26AM -0800, Brendan Gregg escreveu:
> 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

In other places such tests are overridable via '-f' (force), this one
should too, I think.

# perf report
File perf.data not owned by current user or root (use -f to override)
[root@zoo linux]# ls -la perf.data
-rw-------. 1 acme acme 20032 Nov 12 15:50 perf.data

- Arnaldo

> 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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-11-12 18:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 18:27 /tmp/perf-PID.map ownership Brendan Gregg
2015-11-12 18:52 ` Arnaldo Carvalho de Melo [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151112185205.GA7160@kernel.org \
    --to=acme@kernel.org \
    --cc=brendan.d.gregg@gmail.com \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.