[PATCH -next -v4 09/17] LSM: rename inode_getattr to path_getattr and pass struct file
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Tue Nov 17 15:30:28 UTC 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] bpf: missing vfs_getattr_file() in btf_allowlist_d_path
breaks stat tracing
--
commit 0fd5e45352f3174f9865b405ef695f6fda94ab43
Author: Cai Xinchen <caixinchen1 at huawei.com>
LSM: rename inode_getattr to path_getattr and pass struct file
This commit renames the inode_getattr LSM hook and security_inode_getattr()
to path_getattr and security_path_getattr(), adds a struct file parameter,
and introduces vfs_getattr_file() for callers that hold an open file.
> diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
> index 3107400454982..7006e1830269d 100644
> --- a/kernel/trace/bpf_trace.c
> +++ b/kernel/trace/bpf_trace.c
> @@ -962,7 +962,7 @@ BPF_CALL_3(bpf_d_path, const struct path *, path, char *, buf, u32, sz)
> BTF_SET_START(btf_allowlist_d_path)
> #ifdef CONFIG_SECURITY
> BTF_ID(func, security_file_permission)
> -BTF_ID(func, security_inode_getattr)
> +BTF_ID(func, security_path_getattr)
> BTF_ID(func, security_file_open)
> #endif
> #ifdef CONFIG_SECURITY_PATH
[Severity: Medium]
Should vfs_getattr_file also be added to btf_allowlist_d_path alongside
vfs_getattr?
vfs_fstat() and vfs_statx_path() now call vfs_getattr_file() directly
instead of vfs_getattr(), so fentry/vfs_getattr and fexit/vfs_getattr
programs no longer fire on stat-family syscalls. Without
BTF_ID(func, vfs_getattr_file) in btf_allowlist_d_path,
bpf_d_path_allowed() rejects tracing programs that attach to
vfs_getattr_file() and call bpf_d_path(), and on kernels with
CONFIG_SECURITY disabled no allowlisted function remains on those syscall
paths.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261117150542.1169451-1-caixinchen1@huawei.com?part=9
More information about the Linux-security-module-archive
mailing list