linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Max Kellermann <max.kellermann@ionos.com>
Cc: Michael Forney <mforney@mforney.org>, Jan Kara <jack@suse.cz>,
	 Theodore Ts'o <tytso@mit.edu>, Xiubo Li <xiubli@redhat.com>,
	Ilya Dryomov <idryomov@gmail.com>,
	 Jeff Layton <jlayton@kernel.org>, Jan Kara <jack@suse.com>,
	Dave Kleikamp <shaggy@kernel.org>,
	 ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	 jfs-discussion@lists.sourceforge.net,
	Yang Xu <xuyang2018.jy@fujitsu.com>,
	 linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2] fs/{posix_acl,ext2,jfs,ceph}: apply umask if ACL support is disabled
Date: Fri, 15 Mar 2024 14:52:24 +0100	[thread overview]
Message-ID: <20240315-hasst-anmachen-4c9e89a56840@brauner> (raw)
In-Reply-To: <CAKPOu+910gjDp9Lk3sW=CmTM8j_FHEYyfH-kQKz-piRJHkQiDw@mail.gmail.com>

On Thu, Mar 14, 2024 at 02:08:04PM +0100, Max Kellermann wrote:
> On Wed, Mar 13, 2024 at 9:39 PM Michael Forney <mforney@mforney.org> wrote:
> > Turns out that symlinks are inheriting umask on my system (which
> > has CONFIG_EXT4_FS_POSIX_ACL=n):
> >
> > $ umask 022
> > $ ln -s target symlink
> > $ ls -l symlink
> > lrwxr-xr-x    1 michael  michael           6 Mar 13 13:28 symlink -> target
> > $
> >
> > Looking at the referenced functions, posix_acl_create() returns
> > early before applying umask for symlinks, but ext4_init_acl() now
> > applies the umask unconditionally.
> 
> Indeed, I forgot to exclude symlinks from this - sorry for the breakage.
> 
> > After reverting this commit, it works correctly. I am also unable
> > to reproduce the mentioned issue with O_TMPFILE after reverting the
> > commit. It seems that the bug was fixed properly in ac6800e279a2
> > ('fs: Add missing umask strip in vfs_tmpfile'), and all branches
> > that have this ext4_init_acl patch already had ac6800e279a2 backported.
> 
> I can post a patch that adds the missing check or a revert - what do
> the FS maintainers prefer?

If it works correctly with a revert we should remove the code rather
than adding more code to handle a special case.

> 
> (There was a bug with O_TMPFILE ignoring umasks years ago - I first
> posted the patch in 2018 or so - but by the time my patch actually got
> merged, the bug had already been fixed somewhere else IIRC.)

Yeah, we fixed it a while ago and then I added generic VFS level umask
handling but POSIX ACL are hurting us because they're a massive layering
violation on that front.


  reply	other threads:[~2024-03-15 13:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19  8:18 [PATCH] fs: apply umask if POSIX ACL support is disabled Max Kellermann
2023-09-21  0:51 ` Xiubo Li
2023-10-03 15:32 ` Dave Kleikamp
2023-10-07  1:19   ` Xiubo Li
2023-10-09 14:43   ` [PATCH v2] fs/{posix_acl,ext2,jfs,ceph}: apply umask if " Max Kellermann
2023-10-09 16:49     ` Dave Kleikamp
2023-10-10 13:11     ` Jan Kara
2023-10-10 13:17       ` Max Kellermann
2023-10-11 10:05         ` Jan Kara
2023-10-11 10:51           ` Max Kellermann
2023-10-11 12:06             ` Jan Kara
2023-10-11 12:18               ` Max Kellermann
2023-10-11 12:27                 ` Jan Kara
2023-10-11 12:27                 ` Max Kellermann
2023-10-11 13:59                   ` Jan Kara
2023-10-11 15:27                     ` Christian Brauner
2023-10-11 16:29                       ` Jan Kara
2023-10-12  9:22                         ` Christian Brauner
2023-10-12  9:41                           ` Jan Kara
2023-10-11 17:00                       ` Theodore Ts'o
2023-10-11 17:26                         ` Jan Kara
2023-10-12 14:29                           ` Theodore Ts'o
2023-10-12 14:42                             ` Jan Kara
2024-03-13 20:40                               ` Michael Forney
2024-03-14 13:08                                 ` Max Kellermann
2024-03-15 13:52                                   ` Christian Brauner [this message]
2023-10-09 14:45   ` [PATCH] fs: apply umask if POSIX " Max Kellermann

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=20240315-hasst-anmachen-4c9e89a56840@brauner \
    --to=brauner@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=jlayton@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max.kellermann@ionos.com \
    --cc=mforney@mforney.org \
    --cc=shaggy@kernel.org \
    --cc=tytso@mit.edu \
    --cc=xiubli@redhat.com \
    --cc=xuyang2018.jy@fujitsu.com \
    /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).