mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Denys Vlasenko <vda.linux@googlemail.com>
To: Lennart Poettering <mzxreary@0pointer.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Can access to /proc/$PID/exe be relaxed?
Date: Tue, 21 Jul 2009 19:06:41 +0200	[thread overview]
Message-ID: <1158166a0907211006u5e2933f8y40dd2c56055bfc93@mail.gmail.com> (raw)
In-Reply-To: <20090721165248.GA27549@tango.0pointer.de>

On Tue, Jul 21, 2009 at 6:52 PM, Lennart Poettering<mzxreary@0pointer.de> wrote:
> Hi!
>
> Unless I am mistaken a process currently needs CAP_SYS_PTRACE to read
> /proc/$PID/exe for abritrary processes.

You mean "readlink'?

> Does that make sense? Could
> that be relaxed? Is there any reason to limit access to that link at
> all? To me the data from /proc/$PID/cmdline seems to be far more
> worthy to be protected than /proc/$PID/exe, or am I missing something?
>
> Tbh, looking at the code I don't really get where CAP_SYS_PTRACE seems
> to be required, but experimenting from userspace this seems to be the
> case.

Another annoying thing is that sometimes processes cannot open
their own /proc/self/fd/N. Example:

# setuidgid 200:200 cat /proc/self/fd/0
cat: /proc/self/fd/0: Permission denied

In real life this happened when I wanted to redirect apache's
log to stderr. The config directive only allowed redirecting
to a file, so I specified /proc/self/fd/2. It does not work
if apache drops root after startup.

--
vda

  reply	other threads:[~2009-07-21 17:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21 16:52 Lennart Poettering
2009-07-21 17:06 ` Denys Vlasenko [this message]
2009-07-21 17:17   ` Lennart Poettering

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=1158166a0907211006u5e2933f8y40dd2c56055bfc93@mail.gmail.com \
    --to=vda.linux@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mzxreary@0pointer.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®