From: Miklos Szeredi <miklos@szeredi.hu>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux-Fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] vfs: fix linkat error for unprivileged AT_EMPTY_PATH
Date: Thu, 25 Sep 2014 16:31:22 +0200 [thread overview]
Message-ID: <CAJfpegtQJ1MRWe21PTjfpNh2OWEZdgFXuTGTOWQHGLyyk9eGpQ@mail.gmail.com> (raw)
In-Reply-To: <20140924190058.GE7996@ZenIV.linux.org.uk>
On Wed, Sep 24, 2014 at 9:00 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Wed, Sep 24, 2014 at 05:25:23PM +0200, Miklos Szeredi wrote:
>> From: Miklos Szeredi <mszeredi@suse.cz>
>>
>> Return proper error value for linkat(..., AT_EMPTY_PATH) without enough
>> privileges.
>>
>> I guess ENOENT was used here, because without AT_EMPTY_PATH that's what
>> we'd return for an empty path. But it is wrong for AT_EMPTY_PATH, since we
>> might not even be passing an empty path, we are simply complaining about
>> lack of privs for which EPERM is the proper error.
>
> Umm... Are you sure that nothing in userland is checking for that
> return value? I agree that EPERM would make more sense, but...
How could I be sure?
But does it even make sense to check for that error value? I don't
think it is, since we have never allowed unprivileged AT_EMPTY_PATH
for linkat (except by bb2314b4799649 which was reverted before being
included in a release).
So if when (if ever) we do allow that, *then* testing for an error
value will make sense. But surely if one is writing code which can't
even be tested, then it won't come as a big surprise if it will
eventually fail...
Thanks,
Miklos
prev parent reply other threads:[~2014-09-25 14:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-24 15:25 [PATCH] vfs: fix linkat error for unprivileged AT_EMPTY_PATH Miklos Szeredi
2014-09-24 19:00 ` Al Viro
2014-09-25 14:31 ` Miklos Szeredi [this message]
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=CAJfpegtQJ1MRWe21PTjfpNh2OWEZdgFXuTGTOWQHGLyyk9eGpQ@mail.gmail.com \
--to=miklos@szeredi.hu \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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).