Re: [GIT PULL] execve updates for v6.13-rc1
From: Linus Torvalds
Date: Thu Nov 21 2024 - 14:24:19 EST
On Thu, 21 Nov 2024 at 10:50, Kees Cook <kees@xxxxxxxxxx> wrote:
>
> The only flip side I can see is that "ps" etc, should just never use comm
> at all, and instead use argv[0] from cmdline
Gods people, what are you all on about?
THIS IS WHAT PS ALREADY DOES.
Stop this completely inane discussion. It's literally like you don't
even know what you are talking about.
For user space, comm[] is basically the fallback for when cmdline
fails for some reason (for example, /proc/*/cmdline will be empty for
kworkers, but there are other situations too)
The reason? comm[] has *always* been much too limited for 'ps' output. ALWAYS.
Yes, you can literally *force* ps to not do that (eg "ps -eo comm")
but if you do that, you get the very limited comm[] output that nobody
has ever wanted ps to give exactly because it's so limited.
People who want 'argv[0]' will typically want argv[1] etc too, because
argv[0] simply IS NOT SPECIAL.
And yes, 'top' will give comm[] output because it's so much faster.
I'm done with this discussion that apparently was brought on by people
not knowing what the hell they were doing.
Linus