[PATCH v3 -next 07/18] LSM: pass struct path and struct file to the inode posix acl hooks

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Oct 27 13:10:04 UTC 2026


> The inode_set_acl, inode_get_acl and inode_remove_acl hooks are
> called from fs/posix_acl.c, whose helpers now hold a struct path and
> used to derive the dentry from it just for the hook calls.
> 
> Convert the hooks and their SELinux, Smack, EVM and IMA
> implementations to take a const struct path, keeping the idmap as a
> separate argument.  The implementations derive the dentry they still
> need from the path, so this is a purely mechanical change with no
> behavior change.
> 
> Also pass the struct file through which a posix acl operation is
> requested, when there is one, so that LSMs can later authorize
> file descriptor-based operations (fsetxattr(2), fgetxattr(2) and
> fremovexattr(2) on the system.posix_acl_access and
> system.posix_acl_default names, the *xattrat(2) syscalls with
> AT_EMPTY_PATH, and io_uring's IORING_OP_FSETXATTR and
> IORING_OP_FGETXATTR) with the rights available at open(2) time.
> The file is threaded through vfs_set_acl(), vfs_get_acl(),
> vfs_remove_acl(), do_set_acl() and do_get_acl(), and set to NULL
> for path-based operations and for in-kernel users: overlayfs,
> ecryptfs and the SMB server.  No implementation uses the file yet,
> so this part is a purely mechanical change with no behavior change
> either.
> 
> 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=7




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