Re: [PATCH] vfs: add fchmodat2 syscall

2020-09-11 Thread Christoph Hellwig
On Thu, Sep 10, 2020 at 01:02:56PM -0400, Rich Felker wrote: > Would you be happy with a pair of patches where the first blocks chmod > of symlinks in chmod_common and the second adds the syscall with > flags? I think this is a clearly understandable fix, but it does > eliminate the ability to

RE: [PATCH] vfs: add fchmodat2 syscall

2020-09-10 Thread David Laight
From: Rich Felker > Sent: 10 September 2020 15:24 ... > index 9af548fb841b..570a21f4d81e 100644 > --- a/fs/open.c > +++ b/fs/open.c > @@ -610,15 +610,30 @@ SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode) > return err; > } > > -static int do_fchmodat(int dfd, const char __user

Re: [PATCH] vfs: add fchmodat2 syscall

2020-09-10 Thread Rich Felker
On Thu, Sep 10, 2020 at 04:18:28PM +0100, Al Viro wrote: > On Thu, Sep 10, 2020 at 10:23:37AM -0400, Rich Felker wrote: > > > It was determined (see glibc issue #14578 and commit a492b1e5ef) that, > > on some filesystems, performing chmod on the link itself produces a > > change in the inode's

Re: [PATCH] vfs: add fchmodat2 syscall

2020-09-10 Thread Greg KH
On Thu, Sep 10, 2020 at 10:23:37AM -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

Re: [PATCH] vfs: add fchmodat2 syscall

2020-09-10 Thread Rich Felker
On Thu, Sep 10, 2020 at 05:42:34PM +0100, Christoph Hellwig wrote: > On Thu, Sep 10, 2020 at 12:39:50PM -0400, Rich Felker wrote: > > On Thu, Sep 10, 2020 at 05:20:59PM +0100, Christoph Hellwig wrote: > > > On Thu, Sep 10, 2020 at 10:23:37AM -0400, Rich Felker wrote: > > > > userspace emulation

Re: [PATCH] vfs: add fchmodat2 syscall

2020-09-10 Thread Christoph Hellwig
On Thu, Sep 10, 2020 at 12:39:50PM -0400, Rich Felker wrote: > On Thu, Sep 10, 2020 at 05:20:59PM +0100, Christoph Hellwig wrote: > > On Thu, Sep 10, 2020 at 10:23:37AM -0400, Rich Felker wrote: > > > userspace emulation done in libc implementations. No change is made to > > > the underlying

Re: [PATCH] vfs: add fchmodat2 syscall

2020-09-10 Thread Rich Felker
On Thu, Sep 10, 2020 at 05:20:59PM +0100, Christoph Hellwig wrote: > On Thu, Sep 10, 2020 at 10:23:37AM -0400, Rich Felker wrote: > > userspace emulation done in libc implementations. No change is made to > > the underlying chmod_common(), so it's still possible to attempt > > changes via procfs,

Re: [PATCH] vfs: add fchmodat2 syscall

2020-09-10 Thread Rich Felker
On Thu, Sep 10, 2020 at 06:16:15PM +0200, Greg KH wrote: > On Thu, Sep 10, 2020 at 10:23:37AM -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

Re: [PATCH] vfs: add fchmodat2 syscall

2020-09-10 Thread Christoph Hellwig
On Thu, Sep 10, 2020 at 10:23:37AM -0400, Rich Felker wrote: > userspace emulation done in libc implementations. No change is made to > the underlying chmod_common(), so it's still possible to attempt > changes via procfs, if desired. And that is the goddamn problem. We need to fix that _first_.

Re: [PATCH] vfs: add fchmodat2 syscall

2020-09-10 Thread Al Viro
On Thu, Sep 10, 2020 at 10:23:37AM -0400, Rich Felker wrote: > It was determined (see glibc issue #14578 and commit a492b1e5ef) that, > on some filesystems, performing chmod on the link itself produces a > change in the inode's access mode, but returns an EOPNOTSUPP error. Which filesystem types

[PATCH] vfs: add fchmodat2 syscall

2020-09-10 Thread Rich Felker
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