From: Anastasios Papagiannis <tasos.papagiannnis@gmail.com>
To: bpf@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
eddyz87@gmail.com, memxor@gmail.com, viro@zeniv.linux.org.uk,
brauner@kernel.org, jack@suse.cz, tasos.papagiannnis@gmail.com
Subject: [PATCH bpf-next 2/3] docs/bpf: Document bpf_path_getattr()
Date: Thu, 29 Oct 2026 11:59:51 +0200 [thread overview]
Message-ID: <20261029095952.44833-3-tasos.papagiannnis@gmail.com> (raw)
In-Reply-To: <20261029095952.44833-1-tasos.papagiannnis@gmail.com>
Describe the interface, result fields, supported flags, and calling
requirements.
Signed-off-by: Anastasios Papagiannis <tasos.papagiannnis@gmail.com>
---
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
next prev parent reply other threads:[~2026-10-29 10:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 9:59 [PATCH bpf-next 0/3] bpf: Add bpf_path_getattr() Anastasios Papagiannis
2026-10-29 9:59 ` [PATCH bpf-next 1/3] " Anastasios Papagiannis
2026-10-29 10:55 ` bot+bpf-ci
2026-10-29 9:59 ` Anastasios Papagiannis [this message]
2026-10-29 9:59 ` [PATCH bpf-next 3/3] selftests/bpf: Test bpf_path_getattr() Anastasios Papagiannis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261029095952.44833-3-tasos.papagiannnis@gmail.com \
--to=tasos.papagiannnis@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=memxor@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®