From: Florian Weimer <fweimer@bfk.de>
To: Jamie Lokier <jamie@shareable.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
Valdis.Kletnieks@vt.edu, linux@treblig.org, agruen@suse.de,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vfs: new O_NODE open flag
Date: Wed, 30 Sep 2009 08:18:21 +0000 [thread overview]
Message-ID: <82d4589776.fsf@mid.bfk.de> (raw)
In-Reply-To: <20090928132845.GC19778@shareable.org> (Jamie Lokier's message of "Mon\, 28 Sep 2009 14\:28\:45 +0100")
* Jamie Lokier:
> I hope the above cannot convert O_NOACCESS to O_RDWR without checking
> that you have access to the file.
It doesn't.
Here's what I did to reproduce:
$ mkdir /tmp/xyz
$ touch /tmp/xyz/123
$ tail -f /tmp/xyz/123
And in another terminal:
$ chmod 000 /tmp/xyz
$ echo foo > /tmp/xyz/123
bash: /tmp/xyz/123: Permission denied
$ $ echo foo > /proc/$pid_of_tail/fd/5
And the first terminal prints "foo". It fails if the file it self is
not writeable, only the access check on the path is bypassed. I still
think this is wrong.
FWIW, fcntl(F_SETFL) is documented to ignore O_RDWR etc. flags. For
/proc/PID/fd, it probably makes sense to check the current access
flags on the object, and the original open mode. Rechecking the path
seems impossible because it has unclear semantics.
The whole thing is a bit worrisome because it may turn file descriptor
information leaks into something worse.
--
Florian Weimer <fweimer@bfk.de>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-09-30 8:18 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-24 14:51 [PATCH] vfs: new O_NODE open flag Miklos Szeredi
2009-09-25 0:23 ` Andreas Gruenbacher
2009-09-25 5:52 ` Miklos Szeredi
2009-09-25 12:37 ` Dr. David Alan Gilbert
2009-09-25 12:18 ` Miklos Szeredi
2009-09-25 17:08 ` Jamie Lokier
2009-09-25 16:53 ` Andreas Dilger
2009-09-25 17:20 ` Valdis.Kletnieks
2009-09-25 18:35 ` Dr. David Alan Gilbert
2009-09-25 21:18 ` Valdis.Kletnieks
2009-09-28 10:25 ` Miklos Szeredi
2009-09-28 13:28 ` Jamie Lokier
2009-09-28 14:07 ` Miklos Szeredi
2009-09-28 14:10 ` Jamie Lokier
2009-09-30 8:18 ` Florian Weimer [this message]
2009-09-28 15:21 ` Andreas Dilger
2009-09-28 16:04 ` Miklos Szeredi
2009-10-04 19:03 ` Pavel Machek
2009-10-04 22:58 ` Jamie Lokier
2009-10-23 17:10 ` /proc filesystem allows bypassing directory permissions on Linux (was Re: [PATCH] vfs: new O_NODE open flag) Pavel Machek
2009-10-14 13:14 ` [PATCH] vfs: new O_NODE open flag Andreas Gruenbacher
2009-09-25 19:02 ` Andreas Dilger
2009-09-28 15:53 ` Jamie Lokier
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=82d4589776.fsf@mid.bfk.de \
--to=fweimer@bfk.de \
--cc=Valdis.Kletnieks@vt.edu \
--cc=agruen@suse.de \
--cc=jamie@shareable.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@treblig.org \
--cc=miklos@szeredi.hu \
/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;
as well as URLs for NNTP newsgroup(s).