lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240512073812.fkrbriddfvfj3igp@quack3>
Date: Sun, 12 May 2024 09:38:12 +0200
From: Jan Kara <jack@...e.cz>
To: David Howells <dhowells@...hat.com>
Cc: Max Kellermann <max.kellermann@...os.com>, Jan Kara <jack@...e.com>,
	Miklos Szeredi <miklos@...redi.hu>,
	Christian Brauner <brauner@...nel.org>, linux-ext4@...r.kernel.org,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] ext4: Don't reduce symlink i_mode by umask if no ACL
 support

On Fri 10-05-24 12:47:21, David Howells wrote:
>     
> If CONFIG_EXT4_FS_POSIX_ACL=n then the fallback version of ext4_init_acl()
> will mask off the umask bits from the new inode's i_mode.  This should not
> be done if the inode is a symlink.  If CONFIG_EXT4_FS_POSIX_ACL=y, then we
> go through posix_acl_create() instead which does the right thing with
> symlinks.
> 
> However, this is actually unnecessary now as vfs_prepare_mode() has already
> done this where appropriate, so fix this by making the fallback version of
> ext4_init_acl() do nothing.
> 
> Fixes: 484fd6c1de13 ("ext4: apply umask if ACL support is disabled")
> Suggested-by: Miklos Szeredi <miklos@...redi.hu>
> Signed-off-by: David Howells <dhowells@...hat.com>
> cc: Max Kellermann <max.kellermann@...os.com>
> cc: Jan Kara <jack@...e.com>
> cc: Christian Brauner <brauner@...nel.org>
> cc: linux-ext4@...r.kernel.org
> cc: linux-fsdevel@...r.kernel.org

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/ext4/acl.h |    5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/fs/ext4/acl.h b/fs/ext4/acl.h
> index ef4c19e5f570..0c5a79c3b5d4 100644
> --- a/fs/ext4/acl.h
> +++ b/fs/ext4/acl.h
> @@ -68,11 +68,6 @@ extern int ext4_init_acl(handle_t *, struct inode *, struct inode *);
>  static inline int
>  ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
>  {
> -	/* usually, the umask is applied by posix_acl_create(), but if
> -	   ext4 ACL support is disabled at compile time, we need to do
> -	   it here, because posix_acl_create() will never be called */
> -	inode->i_mode &= ~current_umask();
> -
>  	return 0;
>  }
>  #endif  /* CONFIG_EXT4_FS_POSIX_ACL */
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ