lkml.org 
[lkml]   [2009]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] vfs: new O_NODE open flag
From
Date
* 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-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-09-30 10:21    [W:0.479 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site