From: Petr Baudis <pasky@suse.cz>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Dumpable tasks and ownership of /proc/*/fd
Date: Tue, 11 Apr 2006 15:40:54 +0200 [thread overview]
Message-ID: <20060411134054.GU27631@pasky.or.cz> (raw)
In-Reply-To: <m1r745ho6s.fsf@ebiederm.dsl.xmission.com>
Dear diary, on Mon, Apr 10, 2006 at 09:42:03AM CEST, I got a letter
where "Eric W. Biederman" <ebiederm@xmission.com> said that...
> The most straight forward is:
> int openat(int dirfd, const char *path, int flags, int mode)
> {
> int orig_dir_fd;
> int result;
> lock()
> orig_dir_fd = open(".");
> fchdir(dirfd);
> result = open(relpath);
> fchdir(orig_dir_fd);
> close(orig_dir_fd);
> unlock();
> return result;
> }
>
> I suspect something like the above needs to be considered if
> you want the emulation to work on old kernels, in the presence
> of suid applications.
>
..snip..
>
> Although I guess you could attempt to use /proc/self/fd/<n>
> and if that gets a permission problem try a slower but more
> reliable path in the emulation.
Oops, I completely forgot about fchdir(). Thanks, I think I will use
something like this for now.
By the way, I would like to return to a statement from your previous
mail:
> Other processes we do need to deny if we aren't dumpable because
> they don't have another way to get that information.
I still don't understand this - so why don't provide them _this_ way to
get that information? What is the security risk?
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time. I think
I have forgotten this before.
next prev parent reply other threads:[~2006-04-11 13:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-08 12:08 Dumpable tasks and ownership of /proc/*/fd Petr Baudis
2006-04-10 5:43 ` Eric W. Biederman
2006-04-10 6:53 ` Petr Baudis
2006-04-10 7:42 ` Eric W. Biederman
2006-04-11 13:40 ` Petr Baudis [this message]
[not found] <5Zkqr-5LI-5@gated-at.bofh.it>
[not found] ` <5ZXrM-3qg-3@gated-at.bofh.it>
2006-04-11 19:30 ` Bodo Eggert
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=20060411134054.GU27631@pasky.or.cz \
--to=pasky@suse.cz \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox