[PATCH v3 -next 03/18] fs: pass struct path to xattr helpers
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Tue Oct 27 12:16:14 UTC 2026
> vfs_setxattr(), vfs_getxattr(), vfs_listxattr() and vfs_removexattr()
> along with their __vfs_setxattr_locked()/__vfs_removexattr_locked()
> counterparts take a struct dentry even though their callers either
> already hold a struct path (or a struct file). Switch them all to
> take a struct path instead of the dentry.
>
> The struct mnt_idmap stays a separate argument: it is taken from the
> mount at the time the path is checked and must be passed down
> unchanged so that the VFS and the filesystem are guaranteed to see
> the same idmap, so it cannot be derived from the path inside the
> helpers. The do_setxattr()/do_getxattr()/removexattr() syscall
> helpers that resolve the path themselves read the idmap once at their
> boundary from the file or path they resolved via
> file_mnt_idmap()/mnt_idmap() and pass it down.
>
> [ ... ]
> influencing the result. Because that function only has a dentry, the
> call cannot be migrated to the new path-based signature; drop the
> check and the now unused user_space_size variable instead.
>
> Signed-off-by: Cai Xinchen <caixinchen1 at huawei.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261027121151.1887650-1-caixinchen1@huawei.com?part=3
More information about the Linux-security-module-archive
mailing list