[PATCH v2 -next 06/18] LSM: pass struct path to the inode xattr hooks
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Oct 15 12:32:26 UTC 2026
> The inode_setxattr, inode_getxattr, inode_listxattr and
> inode_removexattr hooks are called from fs/xattr.c, whose helpers
> now hold a struct path and used to derive the idmap and dentry from
> it just for the hook calls.
>
> Convert the hooks and their commoncap, SELinux, Smack, EVM and IMA
> implementations to take a const struct path. The implementations
> derive the idmap and dentry they still need from the path, so this
> is a purely mechanical change with no behavior change.
>
> Also update the BPF selftest programs that attach to the changed
> hooks (test_get_xattr.c, test_set_remove_xattr.c and
> verifier_lsm_init_xattr.c) to the new signatures, passing
> path->dentry to the dentry xattr kfuncs. The bpf_lsm_* attach
> stubs themselves are generated from lsm_hook_defs.h and need no
> changes.
>
> Assisted-by: opencode: glm-5.3
> Signed-off-by: Cai Xinchen <caixinchen1 at huawei.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261015125425.3246251-1-caixinchen1@huawei.com?part=6
More information about the Linux-security-module-archive
mailing list