Re: [GIT PULL] execve updates for v6.13-rc1
From: Linus Torvalds
Date: Thu Nov 21 2024 - 17:38:47 EST
On Thu, 21 Nov 2024 at 14:06, Kees Cook <kees@xxxxxxxxxx> wrote:
>
> I think I finally figured out why you keep saying this. I think you mean
> to imply "ps -e" (or similar), not "ps". Asking for more process details
> ("ps a", "ps -f", "ps -e", etc) uses cmdline.
Ah. I never use plain 'ps'. The output is too useless.
> Since comm is mutable anyway, I feel like the "friendlier" default for
> userspace would be option 2.
The thing is, I still violently disagree.
I don't see what's "friendlier" in being (a) slower and (b) giving the
wrong output.
argv[0] isn't what we *normally* use.
And I've seen lots of cases where argv[0] is actually plain made-up garbage.
Christ, I went and looked at OUR OWN TEST-CASES, and they just happily
lie about "argv[0]".
Just go check tools/testing/selftests/exec/execveat.c, and see.
So no. THERE IS NO WAY I WILL ACCEPT THE GARBAGE THAT IS ARGV[0].
What is so hard to understand about the fact that argv[0] has never
*EVER* been meaningful? We're not making it so now.
Linus