[PATCH v3 -next 04/18] fs: pass struct path to POSIX ACL helpers

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Oct 27 12:20:48 UTC 2026


> vfs_set_acl(), vfs_get_acl() and vfs_remove_acl() together with the
> do_set_acl()/do_get_acl() syscall helpers 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, now consistently in
> first position: 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.  A stacking filesystem may
> need to decouple the idmap from the path it forwards to the lower
> filesystem: ecryptfs_set_acl() is invoked with ACLs that have already
> been translated into global filesystem ids, so it must keep passing
> &nop_mnt_idmap just like it does for the other vfs_* helpers it
> calls, while ecryptfs_get_acl() threads the idmap of the upper mount
> through to the lower filesystem.
> 
> set_posix_acl() keeps taking the idmap and dentry as it is called
> from inode_operations->set_acl, which operates on a bare dentry.
> 
> The security_inode_*_acl() hooks invoked from fs/posix_acl.c keep
> taking the idmap and dentry for now; they will be converted together
> with the LSM hooks themselves in separate patches.
> 
> 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=4




More information about the Linux-security-module-archive mailing list