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] [day] [month] [year] [list]
Message-ID: <20251215-genuss-neuer-1e3670000df7@brauner>
Date: Mon, 15 Dec 2025 13:37:59 +0100
From: Christian Brauner <brauner@...nel.org>
To: Chuck Lever <cel@...nel.org>
Cc: Al Viro <viro@...iv.linux.org.uk>, linux-fsdevel@...r.kernel.org, 
	linux-ext4@...r.kernel.org, linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org, 
	hirofumi@...l.parknet.co.jp, almaz.alexandrovich@...agon-software.com, tytso@....edu, 
	adilger.kernel@...ger.ca, Volker.Lendecke@...net.de, Chuck Lever <chuck.lever@...cle.com>
Subject: Re: [PATCH v2 1/6] fs: Add case sensitivity info to file_kattr

On Thu, Dec 11, 2025 at 10:21:11AM -0500, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@...cle.com>
> 
> Enable upper layers such as NFSD to retrieve case sensitivity
> information from file systems by adding a case_info field to struct
> file_kattr.
> 
> Add vfs_get_case_info() as a convenience helper for kernel
> consumers. If a filesystem does not provide a fileattr_get hook, it
> returns the default POSIX behavior (case-sensitive,
> case-preserving), which is correct for the majority of Linux
> file systems implementations.
> 
> Signed-off-by: Chuck Lever <chuck.lever@...cle.com>
> ---

Thanks for listening and plumbing this into file_attr() that seems a
much better place than statx().

>  fs/file_attr.c           | 31 +++++++++++++++++++++++++++++++
>  include/linux/fileattr.h | 23 +++++++++++++++++++++++
>  2 files changed, 54 insertions(+)
> 
> diff --git a/fs/file_attr.c b/fs/file_attr.c
> index 1dcec88c0680..609e890b5101 100644
> --- a/fs/file_attr.c
> +++ b/fs/file_attr.c
> @@ -94,6 +94,37 @@ int vfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
>  }
>  EXPORT_SYMBOL(vfs_fileattr_get);
>  
> +/**
> + * vfs_get_case_info - retrieve case sensitivity info for a filesystem
> + * @dentry:	the object to retrieve from
> + * @case_info:	pointer to store result
> + *
> + * Call i_op->fileattr_get() to retrieve case sensitivity information.
> + * If the filesystem does not provide a fileattr_get hook, return
> + * the default POSIX behavior (case-sensitive, case-preserving).
> + *
> + * Return: 0 on success, or a negative error on failure.
> + */
> +int vfs_get_case_info(struct dentry *dentry, u32 *case_info)

Hm, I would much prefer if we followed the statx() model where we have
vfs_getattr{_nosec}() that always returns a struct kstat. So we should
only have vfs_fileattr_get() instead of the special-purpose
vfs_get_case_info() thing.

I guess the main reason you did this is so that you can set the default
without having to touch each filesystem that doesn't do file_attr.

So just move the default setup of case_info into vfs_fileattr_get()?
This way it's also available to other callers of this function such as
overlayfs and ecryptfs. And then just call that in nfsd.

Otherwise I have no complaints about the VFS part.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ