From: Alessandro Di Federico <ale@rev.ng>
To: Christian Brauner <brauner@kernel.org>
Cc: Farid Zakaria <farid.m.zakaria@gmail.com>,
david.laight.linux@gmail.com, jack@suse.cz, jannh@google.com,
kees@kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-mm@kvack.org, mail@johnericson.me, shuah@kernel.org,
viro@zeniv.linux.org.uk, Gemini <assistant@google.com>
Subject: Re: [RFC PATCH] fs: binfmt_misc: introduce eBPF-based matching and interpreter selection
Date: Fri, 31 Jul 2026 00:46:04 +0200 [thread overview]
Message-ID: <20260731004604.53c66732@spawn> (raw)
In-Reply-To: <20260722-raser-leselust-konsolidieren-05f8e36a0782@brauner>
On Wed, 22 Jul 2026 15:33:40 +0200
Christian Brauner <brauner@kernel.org> wrote:
> I think this could even just be part of systemd. You ship the distro
> with a file for that in /etc/binfmt.d/ and systemd loads that bpf
> program for PT_INTERP_WITH_ORIGIN.
One could delegate the feature to user space, but that makes it much
harder to get adopted in a uniform way.
Will systemd, Android [1] and OpenWrt implement this? In the same way?
If so, at that point it could have just been a feature of the Linux ELF
extension.
Of course the Android people could disable the feature even if it's
in the kernel, but if the convention is established by the kernel,
there's really no reason to deviate from it in the way it's implemented.
The whole point of the portability thing is to reduce the assumptions
you make about the target system. Ideally, you just want to use
features widely available in kernels in the wild.
But from what I understand from another thread, your intention is to
use userspace as testbench, correct?
> This is policy that the admin should decide
Agreed, but the admin is probably satisfied with enabling/disabling,
not deciding whether the program header type is `PT_INTERP_WITH_ORIGIN`
or `PT_ORIGIN_ENABLED_INTERP`. Same for the distro maintainers.
> not an arbitrary extension into elf core.
I think that, in order for this to be useful, it needs to be a ELF
feature, not something the admin/distro maintainer puts together in
eBPF.
Then, from a security perspective, AFAIU, implementing this in
eBPF does not solve the problems that have been discussed.
For instance, `selftests/exec: add binfmt_misc bpf-backed handler test`
does string manipulation (no `openat`).
I understand that's just an example and it's not the same as committing
to a new ABI feature, but still.
Overall, I feel like the current proposal pushes back on having a new
ELF feature for security reasons, but then delegates to distro
maintainers who want to use the feature to take those risks. But also,
distro maintainers don't really need this feature because they can just
write /nix.
I love binfmt_misc enabling you to do ./foreign-architecture-binary or
./notepad.exe and spawn qemu/wine (usually with your friendly sysadmin
approval) and extra flexibility in that area with eBPF is super cool.
However if we are thinking about portability, this make sense only if
it's a default-enabled ELF feature (implemented in eBPF or not).
I'd be happy to try to work on the example eBPF program using openat,
address the various security concerns that have been mentioned until it
looks right and then it could be loaded by default, but with an option
to disable it. But I'm not sure whether there's such a thing as "default
loaded eBPF program".
Alternatively, I could extend the ELF core as a parallel feature of
the eBPF-based mechanism, reviving some patches from previous
iterations.
What do you think?
--
Alessandro Di Federico
rev.ng Labs
[1] There's a flavor of nix for Android (using proot) which would
benefit from this:
https://github.com/nix-community/nix-on-droid-app
prev parent reply other threads:[~2026-07-30 23:13 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 4:39 [PATCH 0/2] fs: support $ORIGIN in ELF interpreter paths Farid Zakaria
2026-06-22 4:39 ` [PATCH 1/2] " Farid Zakaria
2026-06-22 9:53 ` Jori Koolstra
2026-06-23 20:14 ` Kees Cook
2026-06-23 20:35 ` Farid Zakaria
2026-06-22 4:39 ` [PATCH 2/2] selftests/exec: add test suites for $ORIGIN interpreter resolution Farid Zakaria
2026-06-22 10:39 ` [PATCH 0/2] fs: support $ORIGIN in ELF interpreter paths Jan Kara
2026-06-22 17:15 ` Farid Zakaria
2026-06-22 21:08 ` John Ericson
2026-06-25 8:50 ` Christian Brauner
2026-06-25 19:34 ` John Ericson
2026-06-26 12:39 ` Jann Horn
2026-06-26 13:26 ` David Laight
2026-06-26 13:34 ` Jann Horn
2026-06-26 16:28 ` David Laight
2026-06-28 12:36 ` Christian Brauner
2026-06-28 13:20 ` Christian Brauner
2026-06-28 18:44 ` David Laight
2026-06-30 16:58 ` Farid Zakaria
2026-07-02 6:47 ` Christian Brauner
2026-06-30 17:59 ` David Laight
2026-07-02 21:42 ` [RFC PATCH] fs: introduce pluggable ELF interpreter loader registry Farid Zakaria
2026-07-03 9:22 ` Christian Brauner
2026-07-03 18:32 ` Farid Zakaria
2026-07-04 8:15 ` Christian Brauner
2026-07-04 21:14 ` [RFC PATCH] fs: binfmt_misc: introduce eBPF-based matching and interpreter selection Farid Zakaria
2026-07-06 16:01 ` Christian Brauner
2026-07-06 16:47 ` Farid Zakaria
2026-07-07 11:34 ` Christian Brauner
2026-07-07 19:45 ` Christian Brauner
2026-07-07 22:44 ` Farid Zakaria
2026-07-08 9:14 ` Christian Brauner
2026-07-08 16:47 ` Christian Brauner
2026-07-09 4:07 ` Farid Zakaria
2026-07-09 8:46 ` Christian Brauner
2026-07-21 23:18 ` Alessandro Di Federico
2026-07-22 13:33 ` Christian Brauner
2026-07-30 22:46 ` Alessandro Di Federico [this message]
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=20260731004604.53c66732@spawn \
--to=ale@rev.ng \
--cc=assistant@google.com \
--cc=brauner@kernel.org \
--cc=david.laight.linux@gmail.com \
--cc=farid.m.zakaria@gmail.com \
--cc=jack@suse.cz \
--cc=jannh@google.com \
--cc=kees@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mail@johnericson.me \
--cc=shuah@kernel.org \
--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