From: Anastasios Papagiannis <tasos.papagiannnis@gmail.com>
To: brauner@kernel.org
Cc: andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org,
daniel@iogearbox.net, eddyz87@gmail.com, jack@suse.cz,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
memxor@gmail.com, tasos.papagiannnis@gmail.com,
viro@zeniv.linux.org.uk
Subject: Re: [PATCH vfs-7.5.bpf v2 1/3] bpf: Add bpf_path_getattr()
Date: Wed, 18 Nov 2026 14:40:16 +0200 [thread overview]
Message-ID: <20261118124016.77086-1-tasos.papagiannnis@gmail.com> (raw)
In-Reply-To: <20261106-spurwechsel-entwachsen-wildpark-e6322e9caf35@brauner>
> So we need mechanisms in bpf to guard against things like that
> architecturally. Ideally it would not just be a filter like in the past.
I have been working on an approach that models dependencies between
LSM hooks and kfuncs and checks for cycles in the verifier.
In my prototype, kfuncs that need this check should be marked with
KF_CHECK_DEPS. When a program calls one of them, the verifier invokes
bpf_lsm_check_kfunc_dependency() to check whether calling it from the
attached hook could close a dependency cycle thus it may result in a
deadlock. The prototype rejects the program if it finds a cycle or if
the necessary dependency information is missing.
I have tried to model the bpf_path_getattr() dependency manually based
on your comment by using the approach that I described. But the difficult
part is to cover all relevant hooks and kfuncs. So I am looking into
whether there is a way to generate or validate some of those dependencies
automatically. I will continue working on this and try to send an RFC if
I can find a reasonable way to handle the dependencies.
This approach could benefit BPF more generally. However, based on my
analysis, it looks like bpf_path_getattr() would not be usable from
the hooks I need (assuming that it will be available for all underlying
file systems). For this reason, I will drop this series for now and look
for another way to obtain the information I need for overlayfs without
introducing such a broad API.
Thanks,
Anastasios
next prev parent reply other threads:[~2026-11-18 12:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 10:46 [PATCH vfs-7.5.bpf v2 0/3] " Anastasios Papagiannis
2026-11-02 10:46 ` [PATCH vfs-7.5.bpf v2 1/3] " Anastasios Papagiannis
2026-11-06 8:36 ` Christian Brauner
2026-11-06 10:38 ` Christian Brauner
2026-11-18 12:40 ` Anastasios Papagiannis [this message]
2026-11-02 10:46 ` [PATCH vfs-7.5.bpf v2 2/3] docs/bpf: Document bpf_path_getattr() Anastasios Papagiannis
2026-11-02 10:46 ` [PATCH vfs-7.5.bpf v2 3/3] selftests/bpf: Test bpf_path_getattr() Anastasios Papagiannis
2026-11-02 22:49 ` [PATCH vfs-7.5.bpf v2 0/3] bpf: Add bpf_path_getattr() Alexei Starovoitov
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=20261118124016.77086-1-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®