linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] corner cases of open() on procfs symlinks
Date: Thu, 6 Jun 2013 10:38:31 +0900	[thread overview]
Message-ID: <CA+55aFxB9GRfxhCg+s3xMCUQ5Sjt+nViRHQA-DPJ_5DB+v57Uw@mail.gmail.com> (raw)
In-Reply-To: <20130606012010.GE13110@ZenIV.linux.org.uk>

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

  reply	other threads:[~2013-06-06  1:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06  1:20 [RFC] corner cases of open() on procfs symlinks Al Viro
2013-06-06  1:38 ` Linus Torvalds [this message]
2013-06-06  2:29   ` Al Viro
2013-06-06  2:40     ` Linus Torvalds

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=CA+55aFxB9GRfxhCg+s3xMCUQ5Sjt+nViRHQA-DPJ_5DB+v57Uw@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).