linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tavis Ormandy <taviso@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: oss-security@lists.openwall.com, linux-man@vger.kernel.org
Subject: Re: [oss-security] [patch] proc.5: tell how to parse /proc/*/stat correctly
Date: Wed, 28 Dec 2022 01:50:03 -0000 (UTC)	[thread overview]
Message-ID: <tog7cb$105a$1@ciao.gmane.io> (raw)
In-Reply-To: 1a1963aa1036ba07@orthanc.ca

On 2022-12-28, Lyndon Nerenberg (VE7TFX/VE6BBM) wrote:
> Dominique Martinet writes:
>
>> But, really, I just don't see how this can practically be said to be parsable...
>
> In its current form it never will be.  The solution is to place
> this variable-length field last.  Then you can "cut -d ' ' -f 51-"
> to get the command+args part (assuming I counted all those fields
> correctly ...)
>
> Of course, this breaks backwards compatability.
>

I think that cut command doesn't handle newlines, you probably need cut
-z, which looks a bit hacky to me. There already is 'ps -q $$ -o comm=',
of course, and that works fine - as well as libprocps.

I don't know, I think just adding the strrchr note seems acceptable.

Tavis.


-- 
 _o)            $ lynx lock.cmpxchg8b.com
 /\\  _o)  _o)  $ finger taviso@sdf.org
_\_V _( ) _( )  @taviso


  reply	other threads:[~2022-12-28  1:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 16:42 [patch] proc.5: tell how to parse /proc/*/stat correctly Alexey Dobriyan
2022-12-22 22:03 ` [oss-security] " Dominique Martinet
2022-12-22 23:21   ` Solar Designer
2022-12-23  0:15     ` Dominique Martinet
2022-12-23  0:21   ` Jan Engelhardt
2022-12-28  0:44   ` Lyndon Nerenberg (VE7TFX/VE6BBM)
2022-12-28  1:50     ` Tavis Ormandy [this message]
2022-12-30 20:15       ` Jakub Wilk
2022-12-28 15:24     ` Shawn Webb
2022-12-28 15:31       ` Shawn Webb
2022-12-28 16:47       ` Demi Marie Obenour
2022-12-28 17:09         ` Jan Engelhardt
2022-12-28 17:25         ` Shawn Webb
2022-12-28 18:02           ` Demi Marie Obenour
2022-12-28 18:36             ` John Helmert III
2022-12-28 19:24             ` Shawn Webb
2022-12-28 19:57               ` Alejandro Colomar
2022-12-28 22:14             ` Theodore Ts'o
2022-12-29  0:33               ` Demi Marie Obenour
2022-12-31 16:31       ` David Laight
2022-12-31 17:27         ` Solar Designer

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='tog7cb$105a$1@ciao.gmane.io' \
    --to=taviso@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=oss-security@lists.openwall.com \
    /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;
as well as URLs for NNTP newsgroup(s).