lkml.org 
[lkml]   [2013]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC] corner cases of open() on procfs symlinks
From
On Thu, Jun 6, 2013 at 10:20 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> I'm not sure whether to treat that as a bug or as a weird misfeature
> enshrined in userland ABI:
> open("/tmp", O_CREAT, 0) => -EISDIR // LAST_NORM case
> open("/", O_CREAT, 0) => -EISDIR // LAST_ROOT
> open(".", O_CREAT, 0) => -EISDIR // LAST_DOT
> open("..", O_CREAT, 0) => -EISDIR // LAST_DOTDOT
> open("/proc/self/cwd", O_CREAT, 0) => success // LAST_BIND
> open("/proc/self/cwd/", O_CREAT, 0) => -EISDIR // trailing slashes

Ok, that looks buggy. O_CREAT should definitely return EISDIR for
/proc/self/cwd too, since it's a directory. I don't think the
O_RDWR/O_WRONLY thing should matter.

> I would obviously
> like to do that - do_last() is far too convoluted as it is; the only
> question is whether we can change the first weirdness... Comments?

Exactly which cases does that change? I have no objections if it's
only the "LAST_BIND" case that now starts returning EISDIR. Is there
anything else it affects?

That said, obviously if something breaks, we'd have to revert it, and
as a cleanup rather than some serious bug (ie this doesn't cause
crashes or security issues), I suspect this should wait until 3.11
regardless. No?

Linus


\
 
 \ /
  Last update: 2013-06-06 05:41    [W:0.060 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site