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@xxxxxxxxxxx> 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.