From: "Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Kees Cook <kees@kernel.org>,
linux-kernel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Dan Carpenter <dan.carpenter@linaro.org>,
Nir Lichtman <nir@lichtman.org>,
syzbot+03e1af5c332f7e0eb84b@syzkaller.appspotmail.com,
Tycho Andersen <tandersen@netflix.com>,
Vegard Nossum <vegard.nossum@oracle.com>
Subject: Re: [GIT PULL] execve updates for v6.13-rc1
Date: Thu, 21 Nov 2024 18:47:50 +0000 [thread overview]
Message-ID: <Zz-AVoa7Ra22LJ5L@kawka3.in.waw.pl> (raw)
In-Reply-To: <CAHk-=whv4q-RBXmc9G7NZ4GiATqE_ORU05f=9g00HkQXbV7vqw@mail.gmail.com>
On Thu, Nov 21, 2024 at 10:02:03AM -0800, Linus Torvalds wrote:
> On Thu, 21 Nov 2024 at 10:00, Zbigniew Jędrzejewski-Szmek
> <zbyszek@in.waw.pl> wrote:
> >
> > Identical — as far as the callee is concerned.
> > Basically, we'd like to switch the execve() that we use in systemd
> > to start everything with fexecve(), but this should be invisible to
> > both the programs that are started and users who call ps/pgrep/….
>
> I'm not discussing this. If you cannot understand the difference
> between comm[] and argv[0], this discussion is entirely pointless.
You brought up argv to say that it's "garbage". I was replying to that
part of your message.
With execve, the initial values of comm and argv are under full
control of the caller, e.g. comm can be set as
'ln -s /bin/sleep /tmp/whatever && /tmp/whatever'.
So comm doesn't have to match the "actual executable name" and
if one is "garbage" then so is the other one.
I very much understand the difference between comm and argv[0].
Once again: the goal is to be able to use fexecve in a way that
doesn't cause a visible change to the called programs. Comm was
previously set to the basename of the path, and if it's set based on
argv[0] with fexecve, we get the behaviour that we want (*) and the
rest of userspace is happy. If we set it to f_path.dentry, userspace
is unhappy.
(*) The exception is when a program is called with an argv[0] that
has some special value. But it's such a niche case that nobody
cares about it. There were some cups printer plugins which passed
something important via argv[0], but that was at least a decade
ago. I'm not aware of anybody trying to do that. In the worst case,
we can fall back to execve for those cases if absolutely necessary.
> I'd suggest you just not use fexecve().
Pffff. That's not helpful. The patch to use fexecve/execveat
in systemd was merged in 2020, but we can't make this the default
behaviour because of the comm blocker.
Zbyszek
next prev parent reply other threads:[~2024-11-21 18:47 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 17:00 Kees Cook
2024-11-20 22:32 ` Linus Torvalds
2024-11-20 22:33 ` Linus Torvalds
2024-11-20 22:50 ` Linus Torvalds
2024-11-21 2:36 ` Al Viro
2024-11-21 2:41 ` Al Viro
2024-11-21 2:51 ` Linus Torvalds
2024-11-21 0:54 ` Eric W. Biederman
2024-11-21 2:23 ` Linus Torvalds
2024-11-21 2:29 ` Kees Cook
2024-11-21 2:45 ` Linus Torvalds
2024-11-21 17:22 ` Zbigniew Jędrzejewski-Szmek
2024-11-21 17:28 ` Linus Torvalds
2024-11-21 17:47 ` Linus Torvalds
2024-11-21 18:00 ` Zbigniew Jędrzejewski-Szmek
2024-11-21 18:02 ` Linus Torvalds
2024-11-21 18:47 ` Zbigniew Jędrzejewski-Szmek [this message]
2024-11-21 18:50 ` Kees Cook
2024-11-21 19:23 ` Linus Torvalds
2024-11-21 21:31 ` Zbigniew Jędrzejewski-Szmek
2024-11-21 21:48 ` Linus Torvalds
2024-11-21 22:24 ` Zbigniew Jędrzejewski-Szmek
2024-11-21 22:06 ` Kees Cook
2024-11-21 22:38 ` Linus Torvalds
[not found] ` <87zflrsw1c.fsf@email.froward.int.ebiederm.org>
2024-11-22 7:47 ` Zbigniew Jędrzejewski-Szmek
2024-11-22 10:21 ` Harald Arnesen
[not found] ` <87frnjqqh6.fsf@email.froward.int.ebiederm.org>
2024-11-24 15:21 ` Zbigniew Jędrzejewski-Szmek
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=Zz-AVoa7Ra22LJ5L@kawka3.in.waw.pl \
--to=zbyszek@in.waw.pl \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dan.carpenter@linaro.org \
--cc=ebiederm@xmission.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nir@lichtman.org \
--cc=syzbot+03e1af5c332f7e0eb84b@syzkaller.appspotmail.com \
--cc=tandersen@netflix.com \
--cc=torvalds@linux-foundation.org \
--cc=vegard.nossum@oracle.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®