[PATCH -next -v4 10/17] LSM: rename the inode xattr hooks to path_xattr hooks

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Nov 17 14:55:53 UTC 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] selftests/bpf: multi-line comment style in
  test_set_remove_xattr()
--

commit 5a35ac0f5c000b29a6a994caacc2c58218d41cdf
Author: Cai Xinchen <caixinchen1 at huawei.com>

LSM: rename the inode xattr hooks to path_xattr hooks

This commit renames the inode_{set,get,list,remove}xattr LSM hooks and
their security_inode_*xattr() wrappers to path_{set,get,list,remove}xattr
and security_path_*xattr(), updating LSM implementations, BPF LSM hooks,
and BPF selftests accordingly.

> diff --git a/tools/testing/selftests/bpf/prog_tests/fs_kfuncs.c b/tools/testing/selftests/bpf/prog_tests/fs_kfuncs.c
> index 43a26ec69a8e3..5145b1f03cac2 100644
> --- a/tools/testing/selftests/bpf/prog_tests/fs_kfuncs.c
> +++ b/tools/testing/selftests/bpf/prog_tests/fs_kfuncs.c

[ ... ]

> @@ -148,13 +148,13 @@ static void test_set_remove_xattr(void)
>  
>  	/* First, test not _locked version of the kfuncs with getxattr. */
>  
> -	/* Read security.bpf.foo and trigger test_inode_getxattr. This
> +	/* Read security.bpf.foo and trigger test_path_getxattr. This
>  	 * bpf program will set security.bpf.bar to "world".
>  	 */
>  	read_and_validate_foo(skel);
>  	validate_bar_match(skel);
>  
> -	/* Read security.bpf.foo and trigger test_inode_getxattr again.
> +	/* Read security.bpf.foo and trigger test_path_getxattr again.
>  	 * This will remove xattr security.bpf.bar.
>  	 */
>  	read_and_validate_foo(skel);
> @@ -167,13 +167,13 @@ static void test_set_remove_xattr(void)
>  
>  	/* Second, test _locked version of the kfuncs, with setxattr */
>  
> -	/* Set security.bpf.foo and trigger test_inode_setxattr. This
> +	/* Set security.bpf.foo and trigger test_path_setxattr. This
>  	 * bpf program will set security.bpf.bar to "world".
>  	 */
>  	set_foo(skel);
>  	validate_bar_match(skel);
>  
> -	/* Set security.bpf.foo and trigger test_inode_setxattr again.
> +	/* Set security.bpf.foo and trigger test_path_setxattr again.
>  	 * This will remove xattr security.bpf.bar.
>  	 */
>  	set_foo(skel);

[Severity: Low]
This isn't a bug, but BPF coding style puts the opening /* of a
multi-line comment on its own line, with the comment text starting on the
next line.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117150542.1169451-1-caixinchen1@huawei.com?part=10



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