[PATCH -next -v4 07/17] LSM: pass struct path and struct file to the inode fileattr hooks
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Tue Nov 17 14:51:43 UTC 2026
> Switch vfs_fileattr_get(), vfs_fileattr_set(), the inode_file_getattr and
> inode_file_setattr hooks and their SELinux implementations to take a
> const struct path, and pass the struct file through which the operation
> is requested when there is one.
>
> vfs_fileattr_get() keeps checking i_op->fileattr_get before calling the
> hook, so the -ENOIOCTLCMD fallback used by the ioctls is unchanged. Add
> an unchecked __vfs_fileattr_get() for the internal users: nfsd's casefold
> probe, and the read of the current attributes in do_vfs_fileattr_set(),
> which is authorized as a whole by the set hook. ksmbd keeps using the
> checked helpers, passing the file it holds or NULL for path-only probes;
> stacking filesystems do the same, so overlayfs keeps its existing
> file:ioctl/file:open workaround until the LSM semantics are agreed on.
>
> Add strong definitions of the two bpf_lsm_* stubs naming the file
> argument file__nullable.
>
> 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/20261117150542.1169451-1-caixinchen1@huawei.com?part=7
More information about the Linux-security-module-archive
mailing list