[PATCH bpf-next 2/3] docs/bpf: Document bpf_path_getattr()
From: Anastasios Papagiannis
Date: Thu Oct 29 2026 - 06:07:03 EST
Describe the interface, result fields, supported flags, and calling
requirements.
Signed-off-by: Anastasios Papagiannis <tasos.papagiannnis@xxxxxxxxx>
---
Documentation/bpf/fs_kfuncs.rst | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/Documentation/bpf/fs_kfuncs.rst b/Documentation/bpf/fs_kfuncs.rst
index 8762c3233a3d..9e0e391bc007 100644
--- a/Documentation/bpf/fs_kfuncs.rst
+++ b/Documentation/bpf/fs_kfuncs.rst
@@ -13,9 +13,22 @@ BPF kfuncs can be used to get these data.
* ``bpf_get_fsverity_digest()``
+ * ``bpf_path_getattr()``
+
To avoid recursions, these kfuncs follow the following rules:
1. These kfuncs are only permitted from BPF LSM function.
2. These kfuncs should not call into other LSM hooks, i.e. security_*(). For
example, ``bpf_get_file_xattr()`` does not use ``vfs_getxattr()``, because
the latter calls LSM hook ``security_inode_getxattr``.
+
+File attributes
+===============
+
+``bpf_path_getattr()`` queries filesystem attributes with statx(2) semantics,
+including overlayfs inode and device identity. Use a trusted hook argument,
+such as the path in ``lsm.s/inode_getattr`` or ``&file->f_path`` in
+``lsm.s/file_open``.
+
+.. kernel-doc:: fs/bpf_fs_kfuncs.c
+ :identifiers: bpf_file_stat bpf_path_getattr
--
2.56.0