linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Rich Felker <dalias@libc.org>
Cc: linux-api@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] vfs: add fchmodat2 syscall
Date: Wed, 16 Sep 2020 08:19:43 +0200	[thread overview]
Message-ID: <20200916061943.GC142621@kroah.com> (raw)
In-Reply-To: <20200916002335.GQ3265@brightrain.aerifal.cx>

On Tue, Sep 15, 2020 at 08:23:38PM -0400, Rich Felker wrote:
> POSIX defines fchmodat as having a 4th argument, flags, that can be
> AT_SYMLINK_NOFOLLOW. Support for changing the access mode of symbolic
> links is optional (EOPNOTSUPP allowed if not supported), but this flag
> is important even on systems where symlinks do not have access modes,
> since it's the only way to safely change the mode of a file which
> might be asynchronously replaced with a symbolic link, without a race
> condition whereby the link target is changed.
> 
> It's possible to emulate AT_SYMLINK_NOFOLLOW in userspace, and both
> musl libc and glibc do this, by opening an O_PATH file descriptor and
> performing chmod on the corresponding magic symlink in /proc/self/fd.
> However, this requires procfs to be mounted and accessible.
> 
> Signed-off-by: Rich Felker <dalias@libc.org>

No kselftest for this new system call, or man page?  How do we know this
actually works and what the expected outcome should be?

thanks,

greg k-h

      parent reply	other threads:[~2020-09-16  6:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16  0:22 [PATCH v2 0/2] changes for addding fchmodat2 syscall Rich Felker
2020-09-16  0:22 ` [PATCH v2 1/2] vfs: block chmod of symlinks Rich Felker
2020-09-16  6:18   ` Greg KH
2020-09-16  6:23     ` Christoph Hellwig
2020-09-16 15:36     ` Rich Felker
2020-09-16  6:25   ` Christoph Hellwig
2020-09-16 15:41     ` Rich Felker
2020-09-17  4:07     ` Al Viro
2020-09-17  4:15       ` Al Viro
2020-09-17 18:42         ` Rich Felker
2020-09-29 17:49         ` Christoph Hellwig
2020-09-16  0:23 ` [PATCH v2 2/2] vfs: add fchmodat2 syscall Rich Felker
2020-09-16  6:01   ` Aleksa Sarai
2020-09-16  6:19   ` Greg KH [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=20200916061943.GC142621@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dalias@libc.org \
    --cc=hch@infradead.org \
    --cc=linux-api@vger.kernel.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).