From: Linus Torvalds <torvalds@linux-foundation.org>
To: Charles Mirabile <cmirabil@redhat.com>
Cc: Christian Brauner <brauner@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Andrew Lutomirski <luto@kernel.org>, Peter Anvin <hpa@zytor.com>
Subject: Re: [PATCH] vfs: relax linkat() AT_EMPTY_PATH - aka flink() - requirements
Date: Thu, 11 Apr 2024 11:13:53 -0700 [thread overview]
Message-ID: <CAHk-=wjuzUTH0ZiPe0dAZ4rcVeNoJxhK8Hh_WRBY-ZqM-pGBqg@mail.gmail.com> (raw)
In-Reply-To: <CABe3_aE_quPE0zKe-p11DF1rBx-+ecJKORY=96WyJ_b+dbxL9A@mail.gmail.com>
On Thu, 11 Apr 2024 at 10:35, Charles Mirabile <cmirabil@redhat.com> wrote:
>
> And a slightly dubious addition to bypass these checks for tmpfiles
> across the board.
Does this make sense?
I 100% agree that one of the primary reasons why people want flink()
is that "open tmpfile, finalize contents and permissions, then link
the final result into the filesystem".
But I would expect that the "same credentials as open" check is the
one that really matters.
And __O_TMPFILE is just a special case that might not even be used -
it's entirely possible to just do the same with a real file (ie
non-O_TMPFILE) and link it in place and remove the original.
Not to mention that ->tmpfile() isn't necessarily even available, so
the whole concept of "use O_TMPFILE and then linkat" is actually
broken. It *has* to be able to fall back to a regular file to work at
all on NFS.
So while I understand your motivation, I actually think it's actively
wrong to special-case __O_TMPFILE, because it encourages a pattern
that is bad.
Linus
next prev parent reply other threads:[~2024-04-11 18:14 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-11 0:10 [PATCH] vfs: relax linkat() AT_EMPTY_PATH - aka flink() - requirements Linus Torvalds
2024-04-11 0:20 ` Linus Torvalds
2024-04-11 2:39 ` Linus Torvalds
2024-04-11 9:04 ` Christian Brauner
2024-04-11 12:25 ` Christian Brauner
2024-04-11 16:21 ` Linus Torvalds
2024-04-12 8:56 ` Christian Brauner
2024-04-11 16:15 ` Linus Torvalds
2024-04-11 16:44 ` Charles Mirabile
2024-04-11 17:29 ` Charles Mirabile
2024-04-11 17:35 ` Charles Mirabile
2024-04-11 18:13 ` Linus Torvalds [this message]
2024-04-11 19:34 ` Linus Torvalds
2024-04-12 7:45 ` Christian Brauner
2024-04-12 15:36 ` Linus Torvalds
2024-04-11 20:08 ` Charles Mirabile
2024-04-11 20:22 ` Linus Torvalds
2024-04-12 6:44 ` Christian Brauner
2024-04-12 6:41 ` Christian Brauner
2024-04-12 9:07 ` Christian Brauner
2024-04-12 17:43 ` Linus Torvalds
2024-04-13 9:41 ` Christian Brauner
2024-04-13 15:16 ` Christian Brauner
2024-04-13 17:07 ` Linus Torvalds
2024-04-12 19:22 ` [PATCH] " Charles Mirabile
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='CAHk-=wjuzUTH0ZiPe0dAZ4rcVeNoJxhK8Hh_WRBY-ZqM-pGBqg@mail.gmail.com' \
--to=torvalds@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=cmirabil@redhat.com \
--cc=hpa@zytor.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@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).