From: "John Ericson" <mail@johnericson.me>
To: "Christian Brauner" <brauner@kernel.org>
Cc: "Farid Zakaria" <farid.m.zakaria@gmail.com>,
"Jan Kara" <jack@suse.cz>, "Kees Cook" <kees@kernel.org>,
"Al Viro" <viro@zeniv.linux.org.uk>,
shuah@kernel.org, linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>,
linux-kselftest <linux-kselftest@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/2] fs: support $ORIGIN in ELF interpreter paths
Date: Thu, 25 Jun 2026 15:34:14 -0400 [thread overview]
Message-ID: <ea5dc2d9-9a90-450a-bbcc-8ae3429ae85c@app.fastmail.com> (raw)
In-Reply-To: <20260625-atomkraftgegner-hunger-kursbuch-b452ff2becab@brauner>
On Thu, Jun 25, 2026, at 4:50 AM, Christian Brauner wrote:
> Also, we change long-standing kernel behavior which will be very
> surprising for any userspace that might implicitly rely on the fact
> that the system loader is used. So even if we were to do something
> like this it would very likely have to be configurable in some way.
Yes that's definitely something that worried me.
> So I'm not enthusiastic about this. I want this to be consistent.
For what it's worth, I somewhat wish the `PT_INTERP` field didn't exist
at all. IMO the ELF spec is very weird for some parts of the same
headers being for the kernel, and the other parts being for userspace.
If there were separate data structures (think encapsulated packets) so
it was crystal clear who was responsible for what, we wouldn't be in
this situation.
While I earlier complained that our
<https://github.com/Mic92/wrap-buddy> work-around was likely to make
some security analyses/policies go haywire, arguably it implements this
behavior: from the kernel's perspective, everything is statically
linked, and the program, entirely in userspace, takes responsibility for
whatever loading it needs.
Put that way, this is less of an ugly work-around than the way I wish
things worked period in a world without `PT_INTERP`. Dynamic linking
would be entirely a userspace concern and the kernel would not know or
care.
----
What about shebangs? It's the same problem, with the same solutions and
pitfalls. We can also make wrapper executables around them that do the
right thing, but turning mere scripts into statically linked binaries is
a bit heavier. I assume the answer is the same, but just want to double
check before we close this off.
Cheers,
John
next prev parent reply other threads:[~2026-06-25 19:34 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 4:39 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 [this message]
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
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=ea5dc2d9-9a90-450a-bbcc-8ae3429ae85c@app.fastmail.com \
--to=mail@johnericson.me \
--cc=brauner@kernel.org \
--cc=farid.m.zakaria@gmail.com \
--cc=jack@suse.cz \
--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=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
Powered by JetHome